Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
edb3368c
Commit
edb3368c
authored
Sep 12, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5048 from Nullreff/image-diff
Fix bug with rendering changing images in commits
parents
4f9bc937
0a05ab91
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
app/views/projects/commits/_image.html.haml
app/views/projects/commits/_image.html.haml
+2
-2
features/project/commits/commits.feature
features/project/commits/commits.feature
+4
-0
features/steps/project/project_browse_commits.rb
features/steps/project/project_browse_commits.rb
+10
-0
No files found.
app/views/projects/commits/_image.html.haml
View file @
edb3368c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%div
.two-up.view
%div
.two-up.view
%span
.wrap
%span
.wrap
.frame.deleted
.frame.deleted
%a
{
href:
project_
tree_path
(
@project
,
tree_join
(
@commit
.
id
,
diff
.
old_path
))}
%a
{
href:
project_
blob_path
(
@project
,
tree_join
(
@commit
.
parent_
id
,
diff
.
old_path
))}
%img
{
src:
"data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"
}
%img
{
src:
"data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"
}
%p
.image-info.hide
%p
.image-info.hide
%span
.meta-filesize
=
"
#{
number_to_human_size
old_file
.
size
}
"
%span
.meta-filesize
=
"
#{
number_to_human_size
old_file
.
size
}
"
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
%span
.meta-height
%span
.meta-height
%span
.wrap
%span
.wrap
.frame.added
.frame.added
%a
{
href:
project_
tree
_path
(
@project
,
tree_join
(
@commit
.
id
,
diff
.
new_path
))}
%a
{
href:
project_
blob
_path
(
@project
,
tree_join
(
@commit
.
id
,
diff
.
new_path
))}
%img
{
src:
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
%img
{
src:
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
%p
.image-info.hide
%p
.image-info.hide
%span
.meta-filesize
=
"
#{
number_to_human_size
file
.
size
}
"
%span
.meta-filesize
=
"
#{
number_to_human_size
file
.
size
}
"
...
...
features/project/commits/commits.feature
View file @
edb3368c
...
@@ -35,3 +35,7 @@ Feature: Project Browse commits
...
@@ -35,3 +35,7 @@ Feature: Project Browse commits
Scenario
:
I
browse huge commit
Scenario
:
I
browse huge commit
Given
I visit huge commit page
Given
I visit huge commit page
Then
I see huge commit message
Then
I see huge commit message
Scenario
:
I
browse a commit with an image
Given
I visit a commit with an image that changed
Then
The diff links to both the previous and current image
features/steps/project/project_browse_commits.rb
View file @
edb3368c
...
@@ -78,4 +78,14 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
...
@@ -78,4 +78,14 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
page
.
should
have_content
"Warning! This is a large diff"
page
.
should
have_content
"Warning! This is a large diff"
page
.
should_not
have_content
"If you still want to see the diff"
page
.
should_not
have_content
"If you still want to see the diff"
end
end
Given
'I visit a commit with an image that changed'
do
visit
project_commit_path
(
@project
,
'cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b'
)
end
Then
'The diff links to both the previous and current image'
do
links
=
page
.
all
(
'.two-up span div a'
)
links
[
0
][
'href'
].
should
=~
%r{blob/bc3735004cb45cec5e0e4fa92710897a910a5957}
links
[
1
][
'href'
].
should
=~
%r{blob/cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b}
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment