2014-10-02 16:42:54 +00:00
|
|
|
class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
|
2012-09-10 15:35:03 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
2014-07-31 14:23:40 +00:00
|
|
|
include RepoHelpers
|
2012-09-10 15:35:03 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see project commits' do
|
2013-01-04 16:50:31 +00:00
|
|
|
commit = @project.repository.commit
|
2012-09-10 11:27:11 +00:00
|
|
|
page.should have_content(@project.name)
|
2014-07-31 14:23:40 +00:00
|
|
|
page.should have_content(commit.message[0..20])
|
2014-10-10 12:39:48 +00:00
|
|
|
page.should have_content(commit.short_id)
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I click atom feed link' do
|
2015-05-09 21:50:51 +00:00
|
|
|
click_link "Commits Feed"
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see commits atom feed' do
|
2013-04-01 15:16:08 +00:00
|
|
|
commit = @project.repository.commit
|
2014-09-24 06:28:41 +00:00
|
|
|
response_headers['Content-Type'].should have_content("application/atom+xml")
|
2015-04-21 16:45:05 +00:00
|
|
|
body.should have_selector("title", text: "#{@project.name}:master commits")
|
2014-09-24 06:28:41 +00:00
|
|
|
body.should have_selector("author email", text: commit.author_email)
|
|
|
|
body.should have_selector("entry summary", text: commit.description[0..10])
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I click on commit link' do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id)
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see commit info' do
|
2014-07-31 14:23:40 +00:00
|
|
|
page.should have_content sample_commit.message
|
|
|
|
page.should have_content "Showing #{sample_commit.files_changed_count} changed files"
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I fill compare fields with refs' do
|
2014-07-31 14:23:40 +00:00
|
|
|
fill_in "from", with: sample_commit.parent_id
|
|
|
|
fill_in "to", with: sample_commit.id
|
2012-09-10 11:27:11 +00:00
|
|
|
click_button "Compare"
|
|
|
|
end
|
|
|
|
|
2015-03-24 07:07:17 +00:00
|
|
|
step 'I unfold diff' do
|
|
|
|
@diff = first('.js-unfold')
|
|
|
|
@diff.click
|
|
|
|
sleep 2
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see additional file lines' do
|
|
|
|
within @diff.parent do
|
|
|
|
first('.new_line').text.should_not have_content "..."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see compared refs' do
|
2012-09-10 11:27:11 +00:00
|
|
|
page.should have_content "Compare View"
|
2012-09-26 17:58:50 +00:00
|
|
|
page.should have_content "Commits (1)"
|
|
|
|
page.should have_content "Showing 2 changed files"
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
2012-11-01 21:57:44 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see breadcrumb links' do
|
2012-11-01 21:57:44 +00:00
|
|
|
page.should have_selector('ul.breadcrumb')
|
|
|
|
page.should have_selector('ul.breadcrumb a', count: 4)
|
|
|
|
end
|
2012-11-10 21:33:10 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see commits stats' do
|
2013-04-03 20:33:42 +00:00
|
|
|
page.should have_content 'Top 50 Committers'
|
2012-11-10 21:33:10 +00:00
|
|
|
page.should have_content 'Committers'
|
|
|
|
page.should have_content 'Total commits'
|
2012-11-14 00:20:37 +00:00
|
|
|
page.should have_content 'Authors'
|
2012-11-10 21:33:10 +00:00
|
|
|
end
|
2013-09-04 07:33:09 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I visit big commit page' do
|
2015-06-01 03:38:07 +00:00
|
|
|
stub_const('Commit::DIFF_SAFE_FILES', 20)
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id)
|
2013-09-04 07:33:09 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see big commit warning' do
|
2014-07-31 14:23:40 +00:00
|
|
|
page.should have_content sample_big_commit.message
|
2014-07-15 16:42:51 +00:00
|
|
|
page.should have_content "Too many changes"
|
2013-09-04 07:33:09 +00:00
|
|
|
end
|
2013-09-11 01:36:04 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I visit a commit with an image that changed' do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id)
|
2013-09-11 01:36:04 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'The diff links to both the previous and current image' do
|
2014-09-24 06:28:41 +00:00
|
|
|
links = all('.two-up span div a')
|
2014-07-31 14:23:40 +00:00
|
|
|
links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}}
|
|
|
|
links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}}
|
2013-09-11 01:36:04 +00:00
|
|
|
end
|
2013-10-09 20:22:37 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I click side-by-side diff button' do
|
2014-12-25 13:55:12 +00:00
|
|
|
click_link "Side-by-side"
|
2013-10-09 20:22:37 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see side-by-side diff button' do
|
2014-12-25 13:55:12 +00:00
|
|
|
page.should have_content "Side-by-side"
|
2013-10-09 20:22:37 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'I see inline diff button' do
|
2014-12-25 13:55:12 +00:00
|
|
|
page.should have_content "Inline"
|
2013-10-09 20:22:37 +00:00
|
|
|
end
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|