2012-09-10 07:27:11 -04:00
|
|
|
class ProjectBrowseCommits < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
|
|
|
|
2012-09-10 07:27:11 -04:00
|
|
|
Then 'I see project commits' do
|
2013-01-04 11:50:31 -05:00
|
|
|
commit = @project.repository.commit
|
2012-09-10 07:27:11 -04:00
|
|
|
page.should have_content(@project.name)
|
|
|
|
page.should have_content(commit.message)
|
|
|
|
page.should have_content(commit.id.to_s[0..5])
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click atom feed link' do
|
|
|
|
click_link "Feed"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I see commits atom feed' do
|
2013-04-01 11:16:08 -04:00
|
|
|
commit = @project.repository.commit
|
2012-09-10 07:27:11 -04:00
|
|
|
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
2013-05-05 10:01:10 -04:00
|
|
|
page.body.should have_selector("title", text: "Recent commits to #{@project.name}")
|
|
|
|
page.body.should have_selector("author email", text: commit.author_email)
|
|
|
|
page.body.should have_selector("entry summary", text: commit.description)
|
2012-09-10 07:27:11 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click on commit link' do
|
|
|
|
visit project_commit_path(@project, ValidCommit::ID)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I see commit info' do
|
|
|
|
page.should have_content ValidCommit::MESSAGE
|
|
|
|
page.should have_content "Showing 1 changed file"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I fill compare fields with refs' do
|
2012-12-20 08:39:39 -05:00
|
|
|
fill_in "from", with: "8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
|
|
|
|
fill_in "to", with: "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
|
2012-09-10 07:27:11 -04:00
|
|
|
click_button "Compare"
|
|
|
|
end
|
|
|
|
|
2012-09-26 13:58:50 -04:00
|
|
|
Then 'I see compared refs' do
|
2012-09-10 07:27:11 -04:00
|
|
|
page.should have_content "Compare View"
|
2012-09-26 13:58:50 -04:00
|
|
|
page.should have_content "Commits (1)"
|
|
|
|
page.should have_content "Showing 2 changed files"
|
2012-09-10 07:27:11 -04:00
|
|
|
end
|
2012-11-01 17:57:44 -04:00
|
|
|
|
|
|
|
Then 'I see breadcrumb links' do
|
|
|
|
page.should have_selector('ul.breadcrumb')
|
|
|
|
page.should have_selector('ul.breadcrumb span.divider', count: 3)
|
|
|
|
page.should have_selector('ul.breadcrumb a', count: 4)
|
|
|
|
|
2013-01-04 14:45:30 -05:00
|
|
|
find('ul.breadcrumb li:first a')['href'].should match(/#{@project.path_with_namespace}\/commits\/master\z/)
|
2012-11-01 17:57:44 -04:00
|
|
|
find('ul.breadcrumb li:last a')['href'].should match(%r{master/app/models/project\.rb\z})
|
|
|
|
end
|
2012-11-10 16:33:10 -05:00
|
|
|
|
|
|
|
Then 'I see commits stats' do
|
2013-04-03 16:33:42 -04:00
|
|
|
page.should have_content 'Top 50 Committers'
|
2012-11-10 16:33:10 -05:00
|
|
|
page.should have_content 'Committers'
|
|
|
|
page.should have_content 'Total commits'
|
2012-11-13 19:20:37 -05:00
|
|
|
page.should have_content 'Authors'
|
2012-11-10 16:33:10 -05:00
|
|
|
end
|
2012-09-10 07:27:11 -04:00
|
|
|
end
|