Commit b1be377fb0b5e76fc1b0d78700eb3e714b66f1c2

Authored by Robert Speicher
1 parent badb092a

Add Spinach feature for Commit breadcrumbs

features/project/commits/commits.feature
@@ -19,3 +19,7 @@ Feature: Project Browse commits @@ -19,3 +19,7 @@ Feature: Project Browse commits
19 Given I visit compare refs page 19 Given I visit compare refs page
20 And I fill compare fields with refs 20 And I fill compare fields with refs
21 Then I see compared refs 21 Then I see compared refs
  22 +
  23 + Scenario: I browse commits for a specific path
  24 + Given I visit my project's commits page for a specific path
  25 + Then I see breadcrumb links
features/steps/project/project_browse_commits.rb
@@ -42,4 +42,13 @@ class ProjectBrowseCommits < Spinach::FeatureSteps @@ -42,4 +42,13 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
42 page.should have_content "Commits (1)" 42 page.should have_content "Commits (1)"
43 page.should have_content "Showing 2 changed files" 43 page.should have_content "Showing 2 changed files"
44 end 44 end
  45 +
  46 + Then 'I see breadcrumb links' do
  47 + page.should have_selector('ul.breadcrumb')
  48 + page.should have_selector('ul.breadcrumb span.divider', count: 3)
  49 + page.should have_selector('ul.breadcrumb a', count: 4)
  50 +
  51 + find('ul.breadcrumb li:first a')['href'].should match(/#{@project.path}\/commits\/master\z/)
  52 + find('ul.breadcrumb li:last a')['href'].should match(%r{master/app/models/project\.rb\z})
  53 + end
45 end 54 end
features/steps/shared/paths.rb
@@ -121,6 +121,10 @@ module SharedPaths @@ -121,6 +121,10 @@ module SharedPaths
121 visit project_commits_path(@project, @project.root_ref, {limit: 5}) 121 visit project_commits_path(@project, @project.root_ref, {limit: 5})
122 end 122 end
123 123
  124 + Given "I visit my project's commits page for a specific path" do
  125 + visit project_commits_path(@project, @project.root_ref + "/app/models/project.rb", {limit: 5})
  126 + end
  127 +
124 Given "I visit my project's network page" do 128 Given "I visit my project's network page" do
125 # Stub GraphCommit max_size to speed up test (10 commits vs. 650) 129 # Stub GraphCommit max_size to speed up test (10 commits vs. 650)
126 Gitlab::GraphCommit.stub(max_count: 10) 130 Gitlab::GraphCommit.stub(max_count: 10)