Skip to content

Commit

Permalink
Merge branch 'sha-link' of https://github.com/cirosantilli/gitlabhq i…
Browse files Browse the repository at this point in the history
…nto cirosantilli-sha-link

Signed-off-by: Dmitriy Zaporozhets <[email protected]>

Conflicts:
	CHANGELOG
  • Loading branch information
dzaporozhets committed Sep 4, 2014
2 parents d5c5691 + 81336bd commit 18e4e99
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ v 7.3.0
- Keyboard shortcuts for productivity (Robert Schilling)
- API: filter issues by state (Julien Bianchi)
- Add system hook for ssh key changes
- Add blob permalink link (Ciro Santilli)

v 7.2.0
- Explore page
Expand Down
3 changes: 3 additions & 0 deletions app/views/projects/blob/_actions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- else
= link_to "blame", project_blame_path(@project, @id), class: "btn btn-small" unless @blob.empty?
= link_to "history", project_commits_path(@project, @id), class: "btn btn-small"
- if @ref != @commit.sha
= link_to 'permalink', project_blob_path(@project,
tree_join(@commit.sha, @path)), class: 'btn btn-small'

- if allowed_tree_edit?
= link_to '#modal-remove-blob', class: "remove-blob btn btn-small btn-remove", "data-toggle" => "modal" do
Expand Down
12 changes: 12 additions & 0 deletions features/project/source/browse_files.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ Feature: Project Browse files
Scenario: I can browse code with Browse Code
Given I click on history link
Then I see Browse code link

# Permalink

Scenario: I click on the permalink link from a branch ref
Given I click on ".gitignore" file in repo
And I click on permalink
Then I am redirected to the permalink URL

Scenario: I don't see the permalink link from a SHA ref
Given I visit project source page for "6d394385cf567f80a8fd85055db1ab4c5295806f"
And I click on ".gitignore" file in repo
Then I don't see the permalink link
13 changes: 13 additions & 0 deletions features/steps/project/browse_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,17 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
page.should_not have_link 'Browse File »'
page.should_not have_link 'Browse Dir »'
end

step 'I click on permalink' do
click_link 'permalink'
end

step 'I am redirected to the permalink URL' do
expect(current_path).to eq(project_blob_path(
@project, @project.repository.commit.sha + '/.gitignore'))
end

step "I don't see the permalink link" do
expect(page).not_to have_link('permalink')
end
end
6 changes: 6 additions & 0 deletions features/steps/shared/paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ module SharedPaths
visit project_tree_path(@project, "6d39438")
end

step 'I visit project source page for' \
' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do
visit project_tree_path(@project,
'6d394385cf567f80a8fd85055db1ab4c5295806f')
end

step 'I visit project tags page' do
visit project_tags_path(@project)
end
Expand Down

0 comments on commit 18e4e99

Please sign in to comment.