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 19 Given I visit compare refs page
20 20 And I fill compare fields with refs
21 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 42 page.should have_content "Commits (1)"
43 43 page.should have_content "Showing 2 changed files"
44 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 54 end
... ...
features/steps/shared/paths.rb
... ... @@ -121,6 +121,10 @@ module SharedPaths
121 121 visit project_commits_path(@project, @project.root_ref, {limit: 5})
122 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 128 Given "I visit my project's network page" do
125 129 # Stub GraphCommit max_size to speed up test (10 commits vs. 650)
126 130 Gitlab::GraphCommit.stub(max_count: 10)
... ...