From 5700842ba8ca2f3100395a9fb98c759e78e63d96 Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Wed, 15 Oct 2014 02:21:21 -0500 Subject: Add Markdown preview to more forms Enable Markdown previews when creating and editing issues, merge requests, and milestones, and when editing notes. --- features/steps/project/merge_requests.rb | 4 ++++ features/steps/shared/diff_note.rb | 14 ++++++------ features/steps/shared/markdown.rb | 39 ++++++++++++++++++++++++++++++++ features/steps/shared/note.rb | 12 +++++----- 4 files changed, 56 insertions(+), 13 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index fae0cec53a6..32bee9a563f 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -10,6 +10,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_link "New Merge Request" end + step 'I click link "Edit"' do + click_link 'Edit' + end + step 'I click link "Bug NS-04"' do click_link "Bug NS-04" end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 10f3ed90b56..bd22e95daee 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -32,7 +32,7 @@ module SharedDiffNote click_diff_line(sample_commit.line_code) within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do fill_in "note[note]", with: "Should fix it :smile:" - find(".js-note-preview-button").trigger("click") + find('.js-md-preview-button').trigger('click') end end @@ -41,7 +41,7 @@ module SharedDiffNote within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do fill_in "note[note]", with: "DRY this up" - find(".js-note-preview-button").trigger("click") + find('.js-md-preview-button').trigger('click') end end @@ -73,7 +73,7 @@ module SharedDiffNote step 'I should not see the diff comment preview button' do within(diff_file_selector) do - page.should have_css(".js-note-preview-button", visible: false) + page.should have_css('.js-md-preview-button', visible: false) end end @@ -131,25 +131,25 @@ module SharedDiffNote step 'I should see the diff comment preview' do within("#{diff_file_selector} form") do - page.should have_css(".js-note-preview", visible: false) + page.should have_css('.js-md-preview', visible: false) end end step 'I should see the diff comment edit button' do within(diff_file_selector) do - page.should have_css(".js-note-write-button", visible: true) + page.should have_css('.js-md-write-button', visible: true) end end step 'I should see the diff comment preview button' do within(diff_file_selector) do - page.should have_css(".js-note-preview-button", visible: true) + page.should have_css('.js-md-preview-button', visible: true) end end step 'I should see two separate previews' do within(diff_file_selector) do - page.should have_css(".js-note-preview", visible: true, count: 2) + page.should have_css('.js-md-preview', visible: true, count: 2) page.should have_content("Should fix it") page.should have_content("DRY this up") end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 8bf138065b0..f3e61aa8e49 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -54,4 +54,43 @@ EOT 'div.description li.task-list-item input[type="checkbox"]:disabled' ) end + + step 'I should not see the Markdown preview' do + find('.gfm-form').should have_css('.js-md-preview', visible: false) + end + + step 'I should not see the Markdown preview button' do + find('.gfm-form').should have_css('.js-md-preview-button', visible: false) + end + + step 'I should not see the Markdown text field' do + find('.gfm-form').should have_css('textarea', visible: false) + end + + step 'I should see the Markdown edit button' do + find('.gfm-form').should have_css('.js-md-write-button', visible: true) + end + + step 'I should see the Markdown preview' do + find('.gfm-form').should have_css('.js-md-preview', visible: true) + end + + step 'I should see the Markdown preview button' do + find('.gfm-form').should have_css('.js-md-preview-button', visible: true) + end + + step 'I write a description like "Nice"' do + find('.gfm-form').fill_in 'Description', with: 'Nice' + end + + step 'I preview a description text like "Bug fixed :smile:"' do + within('.gfm-form') do + fill_in 'Description', with: 'Bug fixed :smile:' + find('.js-md-preview-button').trigger('click') + end + end + + step 'I haven\'t written any description text' do + find('.gfm-form').fill_in 'Description', with: '' + end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 2b2cb47a715..e298312f065 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -23,7 +23,7 @@ module SharedNote step 'I preview a comment text like "Bug fixed :smile:"' do within(".js-main-target-form") do fill_in "note[note]", with: "Bug fixed :smile:" - find(".js-note-preview-button").trigger("click") + find('.js-md-preview-button').trigger('click') end end @@ -51,13 +51,13 @@ module SharedNote step 'I should not see the comment preview' do within(".js-main-target-form") do - page.should have_css(".js-note-preview", visible: false) + page.should have_css('.js-md-preview', visible: false) end end step 'I should not see the comment preview button' do within(".js-main-target-form") do - page.should have_css(".js-note-preview-button", visible: false) + page.should have_css('.js-md-preview-button', visible: false) end end @@ -81,19 +81,19 @@ module SharedNote step 'I should see the comment edit button' do within(".js-main-target-form") do - page.should have_css(".js-note-write-button", visible: true) + page.should have_css('.js-md-write-button', visible: true) end end step 'I should see the comment preview' do within(".js-main-target-form") do - page.should have_css(".js-note-preview", visible: true) + page.should have_css('.js-md-preview', visible: true) end end step 'I should see the comment preview button' do within(".js-main-target-form") do - page.should have_css(".js-note-preview-button", visible: true) + page.should have_css('.js-md-preview-button', visible: true) end end -- cgit v1.2.1 From e1491465de441b386c72726f0b869104d1c15680 Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Thu, 16 Oct 2014 23:10:50 -0500 Subject: Refactor Markdown preview tests Create a new shared module for common issue/merge request behavior, use `expect` syntax instead of `should`, and avoid `visible: false` in the `have_css` matcher. --- features/steps/project/merge_requests.rb | 5 +---- features/steps/shared/diff_note.rb | 18 +++++++++--------- features/steps/shared/issuable.rb | 15 +++++++++++++++ features/steps/shared/markdown.rb | 14 +++++++------- features/steps/shared/note.rb | 12 ++++++------ 5 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 features/steps/shared/issuable.rb (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 32bee9a563f..d5e060bdbe8 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -1,5 +1,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps include SharedAuthentication + include SharedIssuable include SharedProject include SharedNote include SharedPaths @@ -10,10 +11,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_link "New Merge Request" end - step 'I click link "Edit"' do - click_link 'Edit' - end - step 'I click link "Bug NS-04"' do click_link "Bug NS-04" end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index bd22e95daee..8871b93edb6 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -32,7 +32,7 @@ module SharedDiffNote click_diff_line(sample_commit.line_code) within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do fill_in "note[note]", with: "Should fix it :smile:" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click end end @@ -41,7 +41,7 @@ module SharedDiffNote within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do fill_in "note[note]", with: "DRY this up" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click end end @@ -73,7 +73,7 @@ module SharedDiffNote step 'I should not see the diff comment preview button' do within(diff_file_selector) do - page.should have_css('.js-md-preview-button', visible: false) + expect(page).not_to have_css('.js-md-preview-button') end end @@ -131,27 +131,27 @@ module SharedDiffNote step 'I should see the diff comment preview' do within("#{diff_file_selector} form") do - page.should have_css('.js-md-preview', visible: false) + expect(page).to have_css('.js-md-preview') end end step 'I should see the diff comment edit button' do within(diff_file_selector) do - page.should have_css('.js-md-write-button', visible: true) + expect(page).to have_css('.js-md-write-button') end end step 'I should see the diff comment preview button' do within(diff_file_selector) do - page.should have_css('.js-md-preview-button', visible: true) + expect(page).to have_css('.js-md-preview-button') end end step 'I should see two separate previews' do within(diff_file_selector) do - page.should have_css('.js-md-preview', visible: true, count: 2) - page.should have_content("Should fix it") - page.should have_content("DRY this up") + expect(page).to have_css('.js-md-preview', count: 2) + expect(page).to have_content("Should fix it") + expect(page).to have_content("DRY this up") end end diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb new file mode 100644 index 00000000000..a0150e90380 --- /dev/null +++ b/features/steps/shared/issuable.rb @@ -0,0 +1,15 @@ +module SharedIssuable + include Spinach::DSL + + def edit_issuable + find('.issue-btn-group').click_link 'Edit' + end + + step 'I click link "Edit" for the merge request' do + edit_issuable + end + + step 'I click link "Edit" for the issue' do + edit_issuable + end +end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index f3e61aa8e49..df4514b5646 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -56,27 +56,27 @@ EOT end step 'I should not see the Markdown preview' do - find('.gfm-form').should have_css('.js-md-preview', visible: false) + expect(find('.gfm-form')).not_to have_css('.js-md-preview') end step 'I should not see the Markdown preview button' do - find('.gfm-form').should have_css('.js-md-preview-button', visible: false) + expect(find('.gfm-form')).not_to have_css('.js-md-preview-button') end step 'I should not see the Markdown text field' do - find('.gfm-form').should have_css('textarea', visible: false) + expect(find('.gfm-form')).not_to have_css('textarea') end step 'I should see the Markdown edit button' do - find('.gfm-form').should have_css('.js-md-write-button', visible: true) + expect(find('.gfm-form')).to have_css('.js-md-write-button') end step 'I should see the Markdown preview' do - find('.gfm-form').should have_css('.js-md-preview', visible: true) + expect(find('.gfm-form')).to have_css('.js-md-preview') end step 'I should see the Markdown preview button' do - find('.gfm-form').should have_css('.js-md-preview-button', visible: true) + expect(find('.gfm-form')).to have_css('.js-md-preview-button') end step 'I write a description like "Nice"' do @@ -86,7 +86,7 @@ EOT step 'I preview a description text like "Bug fixed :smile:"' do within('.gfm-form') do fill_in 'Description', with: 'Bug fixed :smile:' - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click() end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index e298312f065..a83f74228af 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -23,7 +23,7 @@ module SharedNote step 'I preview a comment text like "Bug fixed :smile:"' do within(".js-main-target-form") do fill_in "note[note]", with: "Bug fixed :smile:" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click end end @@ -51,13 +51,13 @@ module SharedNote step 'I should not see the comment preview' do within(".js-main-target-form") do - page.should have_css('.js-md-preview', visible: false) + expect(page).not_to have_css('.js-md-preview') end end step 'I should not see the comment preview button' do within(".js-main-target-form") do - page.should have_css('.js-md-preview-button', visible: false) + expect(page).not_to have_css('.js-md-preview-button') end end @@ -81,19 +81,19 @@ module SharedNote step 'I should see the comment edit button' do within(".js-main-target-form") do - page.should have_css('.js-md-write-button', visible: true) + expect(page).to have_css('.js-md-write-button') end end step 'I should see the comment preview' do within(".js-main-target-form") do - page.should have_css('.js-md-preview', visible: true) + expect(page).to have_css('.js-md-preview') end end step 'I should see the comment preview button' do within(".js-main-target-form") do - page.should have_css('.js-md-preview-button', visible: true) + expect(page).to have_css('.js-md-preview-button') end end -- cgit v1.2.1 From e06f0ead9843df2688ca2f341a3b37d4d56a955d Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Thu, 16 Oct 2014 23:36:52 -0500 Subject: Fix Markdown preview tests Update Spinach tests for Markdown previews for the new-ish tab UI that replaced the old preview/edit toggle button. --- features/steps/shared/diff_note.rb | 12 +++++++----- features/steps/shared/markdown.rb | 24 +++++++++++++++--------- features/steps/shared/note.rb | 22 ++++++++++++---------- 3 files changed, 34 insertions(+), 24 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 8871b93edb6..aa31a09e326 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -71,9 +71,10 @@ module SharedDiffNote end end - step 'I should not see the diff comment preview button' do + step 'The diff comment preview tab should say there is nothing to do' do within(diff_file_selector) do - expect(page).not_to have_css('.js-md-preview-button') + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_content('Nothing to preview.') end end @@ -135,15 +136,16 @@ module SharedDiffNote end end - step 'I should see the diff comment edit button' do + step 'I should see the diff comment write tab' do within(diff_file_selector) do expect(page).to have_css('.js-md-write-button') end end - step 'I should see the diff comment preview button' do + step 'The diff comment preview tab should display rendered Markdown' do within(diff_file_selector) do - expect(page).to have_css('.js-md-preview-button') + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_css('img.emoji') end end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index df4514b5646..10da67a6ba8 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -56,18 +56,21 @@ EOT end step 'I should not see the Markdown preview' do - expect(find('.gfm-form')).not_to have_css('.js-md-preview') + expect(find('.gfm-form')).not_to have_css('.js-md-preview', visible: true) end - step 'I should not see the Markdown preview button' do - expect(find('.gfm-form')).not_to have_css('.js-md-preview-button') + step 'The Markdown preview tab should say there is nothing to do' do + within(".gfm-form") do + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_content('Nothing to preview.') + end end step 'I should not see the Markdown text field' do - expect(find('.gfm-form')).not_to have_css('textarea') + expect(find('.gfm-form')).not_to have_css('textarea', visible: true) end - step 'I should see the Markdown edit button' do + step 'I should see the Markdown write tab' do expect(find('.gfm-form')).to have_css('.js-md-write-button') end @@ -75,12 +78,15 @@ EOT expect(find('.gfm-form')).to have_css('.js-md-preview') end - step 'I should see the Markdown preview button' do - expect(find('.gfm-form')).to have_css('.js-md-preview-button') + step 'The Markdown preview tab should display rendered Markdown' do + within(".gfm-form") do + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_css('img.emoji') + end end - step 'I write a description like "Nice"' do - find('.gfm-form').fill_in 'Description', with: 'Nice' + step 'I write a description like ":+1: Nice"' do + find('.gfm-form').fill_in 'Description', with: ':+1: Nice' end step 'I preview a description text like "Bug fixed :smile:"' do diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index a83f74228af..9802614ec72 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -33,9 +33,9 @@ module SharedNote end end - step 'I write a comment like "Nice"' do + step 'I write a comment like ":+1: Nice"' do within(".js-main-target-form") do - fill_in "note[note]", with: "Nice" + fill_in "note[note]", with: ":+1: Nice" end end @@ -51,13 +51,14 @@ module SharedNote step 'I should not see the comment preview' do within(".js-main-target-form") do - expect(page).not_to have_css('.js-md-preview') + expect(page).not_to have_css('.js-md-preview', visible: true) end end - step 'I should not see the comment preview button' do + step 'The comment preview tab should say there is nothing to do' do within(".js-main-target-form") do - expect(page).not_to have_css('.js-md-preview-button') + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_content('Nothing to preview.') end end @@ -79,21 +80,22 @@ module SharedNote end end - step 'I should see the comment edit button' do + step 'I should see the comment write tab' do within(".js-main-target-form") do expect(page).to have_css('.js-md-write-button') end end - step 'I should see the comment preview' do + step 'The comment preview tab should be display rendered Markdown' do within(".js-main-target-form") do - expect(page).to have_css('.js-md-preview') + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_css('img.emoji') end end - step 'I should see the comment preview button' do + step 'I should see the comment preview' do within(".js-main-target-form") do - expect(page).to have_css('.js-md-preview-button') + expect(page).to have_css('.js-md-preview') end end -- cgit v1.2.1 From 74c82ae32583ebf335f310a29ffb22d75b356863 Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Sat, 18 Oct 2014 18:24:12 -0500 Subject: Fix houndci warnings --- features/steps/shared/diff_note.rb | 4 ++-- features/steps/shared/markdown.rb | 6 +++--- features/steps/shared/note.rb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index aa31a09e326..7f1dde16c17 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -152,8 +152,8 @@ module SharedDiffNote step 'I should see two separate previews' do within(diff_file_selector) do expect(page).to have_css('.js-md-preview', count: 2) - expect(page).to have_content("Should fix it") - expect(page).to have_content("DRY this up") + expect(page).to have_content('Should fix it') + expect(page).to have_content('DRY this up') end end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 10da67a6ba8..8dfb8ed72e9 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -60,7 +60,7 @@ EOT end step 'The Markdown preview tab should say there is nothing to do' do - within(".gfm-form") do + within('.gfm-form') do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_content('Nothing to preview.') end @@ -79,7 +79,7 @@ EOT end step 'The Markdown preview tab should display rendered Markdown' do - within(".gfm-form") do + within('.gfm-form') do find('.js-md-preview-button').click expect(find('.js-md-preview')).to have_css('img.emoji') end @@ -92,7 +92,7 @@ EOT step 'I preview a description text like "Bug fixed :smile:"' do within('.gfm-form') do fill_in 'Description', with: 'Bug fixed :smile:' - find('.js-md-preview-button').click() + find('.js-md-preview-button').click end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 9802614ec72..52d8c7e50fa 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -35,7 +35,7 @@ module SharedNote step 'I write a comment like ":+1: Nice"' do within(".js-main-target-form") do - fill_in "note[note]", with: ":+1: Nice" + fill_in 'note[note]', with: ':+1: Nice' end end -- cgit v1.2.1 From 5bb8aff5ddcc1debb4406303477c1ddbe618d058 Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Sat, 18 Oct 2014 18:43:45 -0500 Subject: Fix more Markdown preview tests --- features/steps/project/issues/issues.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'features/steps') diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 640603562dd..c0ae5208541 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -1,5 +1,6 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps include SharedAuthentication + include SharedIssuable include SharedProject include SharedNote include SharedPaths -- cgit v1.2.1 From 7a5072c5a8f03cd7342a5f8e74e1fde0250ce360 Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Mon, 20 Oct 2014 21:53:17 -0500 Subject: Fix test assertions Make sure we're asserting the correct thing when testing visible and invisible DOM elements. --- features/steps/shared/diff_note.rb | 8 ++++---- features/steps/shared/markdown.rb | 10 +++++----- features/steps/shared/note.rb | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 7f1dde16c17..28964d54a8f 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -132,26 +132,26 @@ module SharedDiffNote step 'I should see the diff comment preview' do within("#{diff_file_selector} form") do - expect(page).to have_css('.js-md-preview') + expect(page).to have_css('.js-md-preview', visible: true) end end step 'I should see the diff comment write tab' do within(diff_file_selector) do - expect(page).to have_css('.js-md-write-button') + expect(page).to have_css('.js-md-write-button', visible: true) end end step 'The diff comment preview tab should display rendered Markdown' do within(diff_file_selector) do find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji') + expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end end step 'I should see two separate previews' do within(diff_file_selector) do - expect(page).to have_css('.js-md-preview', count: 2) + expect(page).to have_css('.js-md-preview', visible: true, count: 2) expect(page).to have_content('Should fix it') expect(page).to have_content('DRY this up') end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 8dfb8ed72e9..e71700880cd 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -56,7 +56,7 @@ EOT end step 'I should not see the Markdown preview' do - expect(find('.gfm-form')).not_to have_css('.js-md-preview', visible: true) + expect(find('.gfm-form .js-md-preview')).not_to be_visible end step 'The Markdown preview tab should say there is nothing to do' do @@ -67,21 +67,21 @@ EOT end step 'I should not see the Markdown text field' do - expect(find('.gfm-form')).not_to have_css('textarea', visible: true) + expect(find('.gfm-form textarea')).not_to be_visible end step 'I should see the Markdown write tab' do - expect(find('.gfm-form')).to have_css('.js-md-write-button') + expect(find('.gfm-form')).to have_css('.js-md-write-button', visible: true) end step 'I should see the Markdown preview' do - expect(find('.gfm-form')).to have_css('.js-md-preview') + expect(find('.gfm-form')).to have_css('.js-md-preview', visible: true) end step 'The Markdown preview tab should display rendered Markdown' do within('.gfm-form') do find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji') + expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 52d8c7e50fa..17adec3eda1 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -51,7 +51,7 @@ module SharedNote step 'I should not see the comment preview' do within(".js-main-target-form") do - expect(page).not_to have_css('.js-md-preview', visible: true) + expect(find('.js-md-preview')).not_to be_visible end end @@ -82,20 +82,20 @@ module SharedNote step 'I should see the comment write tab' do within(".js-main-target-form") do - expect(page).to have_css('.js-md-write-button') + expect(page).to have_css('.js-md-write-button', visible: true) end end step 'The comment preview tab should be display rendered Markdown' do within(".js-main-target-form") do find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji') + expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) end end step 'I should see the comment preview' do within(".js-main-target-form") do - expect(page).to have_css('.js-md-preview') + expect(page).to have_css('.js-md-preview', visible: true) end end -- cgit v1.2.1 From e4912243c1110f7194ff4e9a3da6f23a3ccac113 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Fri, 26 Sep 2014 16:11:17 +0200 Subject: Transform remove blob link into button. --- features/steps/project/source/browse_files.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 665f5d6d195..ddd501d4f88 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -78,7 +78,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I click on "Remove"' do - click_link 'Remove' + click_button 'Remove' end step 'I click on "Remove file"' do -- cgit v1.2.1 From c3be1517ae3c576f7f4248b82b611a833fe06675 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Mon, 3 Nov 2014 20:35:06 +0100 Subject: Factor '0' * 40 blank ref constants --- features/steps/dashboard/event_filters.rb | 2 +- features/steps/shared/project.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb index 332bfa95d97..3da3d62d0c0 100644 --- a/features/steps/dashboard/event_filters.rb +++ b/features/steps/dashboard/event_filters.rb @@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps step 'this project has push event' do data = { - before: "0000000000000000000000000000000000000000", + before: Gitlab::Git::BLANK_SHA, after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", ref: "refs/heads/new_design", user_id: @user.id, diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 4b833850a1c..bd7e6e1d8b3 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -32,7 +32,7 @@ module SharedProject @project = Project.find_by(name: "Shop") data = { - before: "0000000000000000000000000000000000000000", + before: Gitlab::Git::BLANK_SHA, after: "6d394385cf567f80a8fd85055db1ab4c5295806f", ref: "refs/heads/fix", user_id: @user.id, -- cgit v1.2.1 From 2388fdd7c6274dad8c10f5bc517f0a8b1aa28aa3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 14 Nov 2014 16:06:39 +0200 Subject: Improve fork to namespaces feature * Show namespace thumbnail differently if project was already forked * Show loading spinner when click on fork * Fork link navigates to personal namespace only if no manageable groups exists Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/fork.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index da50ba9ced0..8e58597db20 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -25,4 +25,10 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps step 'I should see a "Name has already been taken" warning' do page.should have_content "Name has already been taken" end + + step 'I fork to my namespace' do + within '.fork-namespaces' do + click_link current_user.name + end + end end -- cgit v1.2.1 From 2f3df4cb567a6f14b5a0e161084c2f4cf6fbf764 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sat, 8 Nov 2014 23:12:14 -0600 Subject: HipChat service: correct service name & use v2 API HipChat refers to their own product camel cased so we should do the same. HipChat no longer recommends people use the deprecated v1 API so switch to using the v2 API by default. hipchat-rb does not yet default to v2 in any version so it must be specified. --- features/steps/project/services.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index d5d58070d86..ffc231cb575 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -10,7 +10,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps step 'I should see list of available services' do page.should have_content 'Project services' page.should have_content 'Campfire' - page.should have_content 'Hipchat' + page.should have_content 'HipChat' page.should have_content 'GitLab CI' page.should have_content 'Assembla' page.should have_content 'Pushover' @@ -33,7 +33,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I click hipchat service link' do - click_link 'Hipchat' + click_link 'HipChat' end step 'I fill hipchat settings' do -- cgit v1.2.1 From 1353f9aa643f86a3f38f3d2dfa8666d3d942293e Mon Sep 17 00:00:00 2001 From: Daniel Aquino Date: Sat, 8 Nov 2014 23:04:31 -0600 Subject: HipChat service: support custom servers HipChat allows users to run their own private servers and to be able to support those we must connect to the correct URL when using one of these custom servers. --- features/steps/project/services.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index ffc231cb575..7a0b47a8fe5 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -47,6 +47,17 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps find_field('Room').value.should == 'gitlab' end + step 'I fill hipchat settings with custom server' do + check 'Active' + fill_in 'Room', with: 'gitlab_custom' + fill_in 'Token', with: 'secretCustom' + fill_in 'Server', with: 'https://chat.example.com' + click_button 'Save' + end + + step 'I should see hipchat service settings with custom server saved' do + find_field('Server').value.should == 'https://chat.example.com' + end step 'I click pivotaltracker service link' do click_link 'PivotalTracker' -- cgit v1.2.1 From 5c1496a4d803de6efe5c81b5d0a3bba7599bf81f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Nov 2014 10:50:15 +0200 Subject: Improve project factories Signed-off-by: Dmitriy Zaporozhets --- features/steps/shared/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index bd7e6e1d8b3..0bd5653538c 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -131,7 +131,7 @@ module SharedProject end step 'public empty project "Empty Public Project"' do - create :empty_project, :public, name: "Empty Public Project" + create :project_empty_repo, :public, name: "Empty Public Project" end step 'project "Community" has comments' do -- cgit v1.2.1 From 4cbe72d76722ce6c3d327ec62f54478a6e955d32 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 2 Dec 2014 11:31:57 +0200 Subject: UI improvements mostly for mobile screens Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/active_tab.rb | 4 ++-- features/steps/project/issues/milestones.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index 83796b0ba88..bb42d15eae5 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -89,8 +89,8 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps click_link('Labels') end - step 'the active sub tab should be Browse Issues' do - ensure_active_sub_tab('Browse Issues') + step 'the active sub tab should be Issues' do + ensure_active_sub_tab('Issues') end step 'the active sub tab should be Milestones' do diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb index 89d7af3c9ee..cce87a6d981 100644 --- a/features/steps/project/issues/milestones.rb +++ b/features/steps/project/issues/milestones.rb @@ -8,7 +8,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps milestone = @project.milestones.find_by(title: "v2.2") page.should have_content(milestone.title[0..10]) page.should have_content(milestone.expires_at) - page.should have_content("Browse Issues") + page.should have_content("Issues") end step 'I click link "v2.2"' do @@ -28,7 +28,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps milestone = @project.milestones.find_by(title: "v2.3") page.should have_content(milestone.title[0..10]) page.should have_content(milestone.expires_at) - page.should have_content("Browse Issues") + page.should have_content("Issues") end step 'project "Shop" has milestone "v2.2"' do -- cgit v1.2.1 From 3a5ed5260b24051939575d1934ce9b8392cac09f Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Thu, 27 Nov 2014 13:34:39 +0200 Subject: Supporting for multiple omniauth provider for the same user --- features/steps/profile/profile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 6d747b65bae..38aaadcd28d 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -170,7 +170,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step "I am not an ldap user" do - current_user.update_attributes(extern_uid: nil, provider: '') + current_user.identities.delete current_user.ldap_user?.should be_false end -- cgit v1.2.1 From 96a648ded25a46335302a7fa392cddfd2e3f4acb Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Mon, 8 Dec 2014 16:22:28 -0800 Subject: Fixes the search test that fails whenever faker uses a name with Bar in it. Limit check to being within the search results div. --- features/steps/search.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/search.rb b/features/steps/search.rb index f3d8bd80f13..6f0e038c4d6 100644 --- a/features/steps/search.rb +++ b/features/steps/search.rb @@ -59,11 +59,11 @@ class Spinach::Features::Search < Spinach::FeatureSteps create(:merge_request, :simple, title: "Bar", source_project: project, target_project: project) end - step 'I should see "Foo" link' do - page.should have_link "Foo" + step 'I should see "Foo" link in the search results' do + find(:css, '.search-results').should have_link 'Foo' end - step 'I should not see "Bar" link' do - page.should_not have_link "Bar" + step 'I should not see "Bar" link in the search results' do + find(:css, '.search-results').should_not have_link 'Bar' end end -- cgit v1.2.1 From bcc04adb1342155d4ec2b670702406285145cb32 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 21 Dec 2014 01:11:08 +0200 Subject: Css/views cleanup after layout restyle Signed-off-by: Dmitriy Zaporozhets --- features/steps/shared/active_tab.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index f41b59a6f2b..d7c7053edbd 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -2,7 +2,7 @@ module SharedActiveTab include Spinach::DSL def ensure_active_main_tab(content) - find('.main-nav li.active').should have_content(content) + find('.sidebar-wrapper li.active').should have_content(content) end def ensure_active_sub_tab(content) @@ -14,7 +14,7 @@ module SharedActiveTab end step 'no other main tabs should be active' do - page.should have_selector('.main-nav li.active', count: 1) + page.should have_selector('.sidebar-wrapper li.active', count: 1) end step 'no other sub tabs should be active' do -- cgit v1.2.1 From 1f2628fe2118642b467e93a362cebb11ca780a40 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 22 Dec 2014 15:02:47 +0200 Subject: Allow Group path to be changed at the same time as name Signed-off-by: Dmitriy Zaporozhets --- features/steps/groups.rb | 3 ++- features/steps/project/create.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 616a297db99..e5b73e53967 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -77,7 +77,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'submit form with new group "Samurai" info' do - fill_in 'group_name', with: 'Samurai' + fill_in 'group_path', with: 'Samurai' fill_in 'group_description', with: 'Tokugawa Shogunate' click_button "Create group" end @@ -94,6 +94,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'I change group "Owned" name to "new-name"' do fill_in 'group_name', with: 'new-name' + fill_in 'group_path', with: 'new-name' click_button "Save group" end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index e1062a6ce39..6b07b62f16f 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -3,7 +3,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps include SharedPaths step 'fill project form with valid data' do - fill_in 'project_name', with: 'Empty' + fill_in 'project_path', with: 'Empty' click_button "Create project" end -- cgit v1.2.1 From 5b49bb208a21fa96d0ae1bb93506725deee6c5b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 22 Dec 2014 16:42:26 +0200 Subject: Fix issueable context update and fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/merge_requests.rb | 10 +++------- features/steps/shared/active_tab.rb | 8 ++++---- features/steps/shared/issuable.rb | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index d5e060bdbe8..b00f610cfae 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -57,9 +57,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "Close"' do - within '.page-title' do - click_link "Close" - end + first(:css, '.close-mr-link').click end step 'I submit new merge request "Wiki Feature"' do @@ -181,13 +179,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "Reopen"' do - within '.page-title' do - click_link "Reopen" - end + first(:css, '.reopen-mr-link').click end step 'I should see reopened merge request "Bug NS-04"' do - within '.state-label' do + within '.issue-box' do page.should have_content "Open" end end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index d7c7053edbd..c229864bc83 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -2,7 +2,7 @@ module SharedActiveTab include Spinach::DSL def ensure_active_main_tab(content) - find('.sidebar-wrapper li.active').should have_content(content) + find('.nav-sidebar > li.active').should have_content(content) end def ensure_active_sub_tab(content) @@ -10,11 +10,11 @@ module SharedActiveTab end def ensure_active_sub_nav(content) - find('div.content ul.nav-stacked-menu li.active').should have_content(content) + find('.sidebar-subnav > li.active').should have_content(content) end step 'no other main tabs should be active' do - page.should have_selector('.sidebar-wrapper li.active', count: 1) + page.should have_selector('.nav-sidebar > li.active', count: 1) end step 'no other sub tabs should be active' do @@ -22,7 +22,7 @@ module SharedActiveTab end step 'no other sub navs should be active' do - page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1) + page.should have_selector('.sidebar-subnav > li.active', count: 1) end step 'the active main tab should be Home' do diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index a0150e90380..41db2612f26 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -2,7 +2,7 @@ module SharedIssuable include Spinach::DSL def edit_issuable - find('.issue-btn-group').click_link 'Edit' + find(:css, '.issuable-edit').click end step 'I click link "Edit" for the merge request' do -- cgit v1.2.1 From d0b1bc222e7486bcb4877a7b8526b1646c2be0fc Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 22 Dec 2014 16:48:40 +0200 Subject: Fix spinach test Signed-off-by: Dmitriy Zaporozhets --- features/steps/admin/groups.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb index d69a87cd07e..4171398e568 100644 --- a/features/steps/admin/groups.rb +++ b/features/steps/admin/groups.rb @@ -22,7 +22,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps end step 'submit form with new group info' do - fill_in 'group_name', with: 'gitlab' + fill_in 'group_path', with: 'gitlab' fill_in 'group_description', with: 'Group description' click_button "Create group" end -- cgit v1.2.1 From 3eb586c12cf46fe0098c5c0fbec8478a44a5d77d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 22 Dec 2014 17:18:53 +0200 Subject: Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/groups.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 616a297db99..66a32a51d75 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -89,7 +89,6 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'I should see newly created group "Samurai"' do page.should have_content "Samurai" page.should have_content "Tokugawa Shogunate" - page.should have_content "Currently you are only seeing events from the" end step 'I change group "Owned" name to "new-name"' do @@ -99,7 +98,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'I should see new group "Owned" name' do within ".navbar-gitlab" do - page.should have_content "group: new-name" + page.should have_content "new-name" end end -- cgit v1.2.1 From 1fa19401e969f79cbd737c55e63249ca9355791c Mon Sep 17 00:00:00 2001 From: Jason Lippert Date: Mon, 8 Dec 2014 16:54:09 -0500 Subject: Teamcity interaction using 8.1 rest api --- features/steps/project/services.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 7a0b47a8fe5..09e86447058 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -15,6 +15,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps page.should have_content 'Assembla' page.should have_content 'Pushover' page.should have_content 'Atlassian Bamboo' + page.should have_content 'JetBrains TeamCity' end step 'I click gitlab-ci service link' do @@ -168,4 +169,23 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps find_field('Build key').value.should == 'KEY' find_field('Username').value.should == 'user' end + + step 'I click JetBrains TeamCity CI service link' do + click_link 'JetBrains TeamCity CI' + end + + step 'I fill JetBrains TeamCity CI settings' do + check 'Active' + fill_in 'Teamcity url', with: 'http://teamcity.example.com' + fill_in 'Build type', with: 'GitlabTest_Build' + fill_in 'Username', with: 'user' + fill_in 'Password', with: 'verySecret' + click_button 'Save' + end + + step 'I should see JetBrains TeamCity CI service settings saved' do + find_field('Teamcity url').value.should == 'http://teamcity.example.com' + find_field('Build type').value.should == 'GitlabTest_Build' + find_field('Username').value.should == 'user' + end end -- cgit v1.2.1 From 7b792af872699cd9439c750b780b0b906342cff0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 24 Dec 2014 11:39:03 +0200 Subject: Improvements to issues/mr filters: * use filter_params variable when set filter values * fix project issues spinach tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/dashboard/issues.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb index 2a5850d091b..b77113e3974 100644 --- a/features/steps/dashboard/issues.rb +++ b/features/steps/dashboard/issues.rb @@ -35,14 +35,20 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps end step 'I click "Authored by me" link' do - within ".scope-filter" do - click_link 'Created by me' + within ".assignee-filter" do + click_link "Any" + end + within ".author-filter" do + click_link current_user.name end end step 'I click "All" link' do - within ".scope-filter" do - click_link "Everyone's" + within ".author-filter" do + click_link "Any" + end + within ".assignee-filter" do + click_link "Any" end end -- cgit v1.2.1 From 97d7c06f781f17a21689cf35410009f1247427e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 24 Dec 2014 12:56:03 +0200 Subject: Fix scroll problems and disable authorized_only filter Signed-off-by: Dmitriy Zaporozhets --- features/steps/dashboard/merge_requests.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb index 75e53173d3f..6261c89924c 100644 --- a/features/steps/dashboard/merge_requests.rb +++ b/features/steps/dashboard/merge_requests.rb @@ -39,14 +39,20 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps end step 'I click "Authored by me" link' do - within ".scope-filter" do - click_link 'Created by me' + within ".assignee-filter" do + click_link "Any" + end + within ".author-filter" do + click_link current_user.name end end step 'I click "All" link' do - within ".scope-filter" do - click_link "Everyone's" + within ".author-filter" do + click_link "Any" + end + within ".assignee-filter" do + click_link "Any" end end -- cgit v1.2.1 From e41dadcb33fda44ee274daa673bd933e13aa90eb Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 19 Dec 2014 16:15:29 +0200 Subject: Doorkeeper integration --- features/steps/profile/profile.rb | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'features/steps') diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 38aaadcd28d..29fc7e68dac 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -221,4 +221,54 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I should see groups I belong to' do page.should have_css('.profile-groups-avatars', visible: true) end + + step 'I click on new application button' do + click_on 'New Application' + end + + step 'I should see application form' do + page.should have_content "New application" + end + + step 'I fill application form out and submit' do + fill_in :doorkeeper_application_name, with: 'test' + fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' + click_on "Submit" + end + + step 'I see application' do + page.should have_content "Application: test" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click edit' do + click_on "Edit" + end + + step 'I see edit application form' do + page.should have_content "Edit application" + end + + step 'I change name of application and submit' do + page.should have_content "Edit application" + fill_in :doorkeeper_application_name, with: 'test_changed' + click_on "Submit" + end + + step 'I see that application was changed' do + page.should have_content "test_changed" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click to remove application' do + within '.oauth-applications' do + click_on "Destroy" + end + end + + step "I see that application is removed" do + page.find(".oauth-applications").should_not have_content "test_changed" + end end -- cgit v1.2.1 From fca161f5c50e282acf65e11decc86a35d5e43847 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 25 Dec 2014 15:55:12 +0200 Subject: Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/commits/commits.rb | 6 +++--- features/steps/project/merge_requests.rb | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 935f313e298..d515ee1ac11 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -78,14 +78,14 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I click side-by-side diff button' do - click_link "Side-by-side Diff" + click_link "Side-by-side" end step 'I see side-by-side diff button' do - page.should have_content "Side-by-side Diff" + page.should have_content "Side-by-side" end step 'I see inline diff button' do - page.should have_content "Inline Diff" + page.should have_content "Inline" end end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index b00f610cfae..28928d602d6 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -109,6 +109,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click on the commit in the merge request' do + within '.merge-request-tabs' do + click_link 'Commits' + end + within '.mr-commits' do click_link Commit.truncate_sha(sample_commit.id) end @@ -261,7 +265,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click Side-by-side Diff tab' do - click_link 'Side-by-side Diff' + click_link 'Side-by-side' end step 'I should see comments on the side-by-side diff page' do -- cgit v1.2.1 From aadfb3665f39e5886254bac856ebd1cc47f8c652 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 25 Dec 2014 18:46:19 +0200 Subject: Fix tests and add message if no oauth apps Signed-off-by: Dmitriy Zaporozhets --- features/steps/shared/paths.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'features/steps') diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 5f292255ce1..ca038732231 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -94,6 +94,10 @@ module SharedPaths visit profile_path end + step 'I visit profile applications page' do + visit applications_profile_path + end + step 'I visit profile password page' do visit edit_profile_password_path end -- cgit v1.2.1 From 465f186954d00fa47c8b05cc91f33e7943aa209a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 26 Dec 2014 18:33:53 +0200 Subject: Show assigned issues/mr be default on dashboard This was default before but now it fixed with providing assignee_id parameter making url shareble and dont reset when other filters users. Also this commit removes old methods that are not used any more. Signed-off-by: Dmitriy Zaporozhets --- features/steps/shared/paths.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index ca038732231..b60d290ae9c 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -1,6 +1,7 @@ module SharedPaths include Spinach::DSL include RepoHelpers + include DashboardHelper step 'I visit new project page' do visit new_project_path @@ -71,11 +72,11 @@ module SharedPaths end step 'I visit dashboard issues page' do - visit issues_dashboard_path + visit assigned_issues_dashboard_path end step 'I visit dashboard merge requests page' do - visit merge_requests_dashboard_path + visit assigned_mrs_dashboard_path end step 'I visit dashboard search page' do -- cgit v1.2.1 From b8bffc0da26ff53a220ec83e71a195666867d28f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 27 Dec 2014 17:48:10 +0200 Subject: Dont check for milestone description on group milestone page Signed-off-by: Dmitriy Zaporozhets --- features/steps/groups.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 0bd7a32f5cb..f09d751dba3 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -188,7 +188,6 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I should see group milestone with descriptions and expiry date' do - page.should have_content('Lorem Ipsum is simply dummy text of the printing and typesetting industry') page.should have_content('expires at Aug 20, 2114') end -- cgit v1.2.1 From 3d2f12308198417a9cbda095a602e9252407732e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 29 Dec 2014 13:31:30 +0200 Subject: Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/merge_requests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 28928d602d6..bd84abae06e 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -265,7 +265,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click Side-by-side Diff tab' do - click_link 'Side-by-side' + find('a', text: 'Side-by-side').trigger('click') end step 'I should see comments on the side-by-side diff page' do -- cgit v1.2.1 From c1e57b47b81db4b3959b0ce63d7f65cb6cdf6f57 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 29 Dec 2014 18:40:25 +0100 Subject: Add feature spec for user ssh keys on admin page. --- features/steps/admin/users.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'features/steps') diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb index 546c1bf2a12..e1383097248 100644 --- a/features/steps/admin/users.rb +++ b/features/steps/admin/users.rb @@ -82,4 +82,36 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps page.should have_content 'Account' page.should have_content 'Personal projects limit' end + + step 'user "Pete" with ssh keys' do + user = create(:user, name: 'Pete') + create(:key, user: user, title: "ssh-rsa Key1", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key1") + create(:key, user: user, title: "ssh-rsa Key2", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2") + end + + step 'click on user "Pete"' do + click_link 'Pete' + end + + step 'I should see key list' do + page.should have_content 'ssh-rsa Key2' + page.should have_content 'ssh-rsa Key1' + end + + step 'I click on the key title' do + click_link 'ssh-rsa Key2' + end + + step 'I should see key details' do + page.should have_content 'ssh-rsa Key2' + page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' + end + + step 'I click on remove key' do + click_link 'Remove' + end + + step 'I should see the key removed' do + page.should_not have_content 'ssh-rsa Key2' + end end -- cgit v1.2.1 From eb29648bf4a9b2ad960a582eba0a51f088afa78f Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 30 Dec 2014 11:47:13 +0100 Subject: Fix the ssh keys test. --- features/steps/profile/ssh_keys.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/profile/ssh_keys.rb b/features/steps/profile/ssh_keys.rb index d1e87d40705..ea912e5b4da 100644 --- a/features/steps/profile/ssh_keys.rb +++ b/features/steps/profile/ssh_keys.rb @@ -37,9 +37,7 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps end step 'I should not see "Work" ssh key' do - within "#keys-table" do - page.should_not have_content "Work" - end + page.should_not have_content "Work" end step 'I have ssh key "ssh-rsa Work"' do -- cgit v1.2.1 From 0930086bea914d4fd32c21706bcdcb3daf529561 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 30 Dec 2014 16:38:27 +0200 Subject: Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/merge_requests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index bd84abae06e..9d23f5da5de 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -113,7 +113,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_link 'Commits' end - within '.mr-commits' do + within '.commits' do click_link Commit.truncate_sha(sample_commit.id) end end -- cgit v1.2.1 From 18fa1550251655ce84a0886caaab7262fbeb9c51 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sun, 28 Sep 2014 11:52:14 +0200 Subject: Add tests for disabled blob edit button cases. --- features/steps/project/source/browse_files.rb | 8 ++++++++ features/steps/shared/paths.rb | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index ddd501d4f88..805e6ff0eac 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -48,6 +48,14 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps click_link 'Edit' end + step 'I cannot see the edit button' do + page.should_not have_link 'edit' + end + + step 'The edit button is disabled' do + page.should have_css '.disabled', text: 'Edit' + end + step 'I can edit code' do set_new_content evaluate_script('editor.getValue()').should == new_gitignore_content diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index b60d290ae9c..e657fceb704 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -183,6 +183,11 @@ module SharedPaths visit project_tree_path(@project, root_ref) end + step 'I visit a binary file in the repo' do + visit project_blob_path(@project, File.join( + root_ref, 'files/images/logo-black.png')) + end + step "I visit my project's commits page" do visit project_commits_path(@project, root_ref, {limit: 5}) end @@ -385,6 +390,11 @@ module SharedPaths visit project_path(project) end + step 'I visit project "Community" source page' do + project = Project.find_by(name: 'Community') + visit project_tree_path(project, root_ref) + end + step 'I visit project "Internal" page' do project = Project.find_by(name: "Internal") visit project_path(project) -- cgit v1.2.1 From 884352294deab0c11845547ce2ab96b60f468458 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 30 Dec 2014 20:10:46 +0200 Subject: Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/merge_requests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 9d23f5da5de..84f1ebc003b 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -156,7 +156,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'merge request is mergeable' do - page.should have_content 'You can accept this request automatically' + page.should have_button 'Accept Merge Request' end step 'I modify merge commit message' do -- cgit v1.2.1 From 67b06e7a9b54e39b2f104079dfb293645d8352c7 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Mon, 29 Sep 2014 23:58:01 +0200 Subject: Change always passing visible true tests to false. --- features/steps/shared/diff_note.rb | 4 ++-- features/steps/shared/note.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 28964d54a8f..510e0f0f938 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -80,7 +80,7 @@ module SharedDiffNote step 'I should not see the diff comment text field' do within(diff_file_selector) do - page.should have_css(".js-note-text", visible: false) + expect(find('.js-note-text')).not_to be_visible end end @@ -115,7 +115,7 @@ module SharedDiffNote end step 'I should see add a diff comment button' do - page.should have_css(".js-add-diff-note-button", visible: false) + page.should have_css('.js-add-diff-note-button', visible: true) end step 'I should see an empty diff comment form' do diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 17adec3eda1..625bcc0b266 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -64,7 +64,7 @@ module SharedNote step 'I should not see the comment text field' do within(".js-main-target-form") do - page.should have_css(".js-note-text", visible: false) + expect(find('.js-note-text')).not_to be_visible end end -- cgit v1.2.1 From 57a65ede77b7bbae6e3b2a7aa52135de7b0c2f8e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Jan 2015 09:53:35 -0800 Subject: Improve application settings and write tests --- features/steps/admin/settings.rb | 16 ++++++++++++++++ features/steps/shared/paths.rb | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 features/steps/admin/settings.rb (limited to 'features/steps') diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb new file mode 100644 index 00000000000..e8168e85def --- /dev/null +++ b/features/steps/admin/settings.rb @@ -0,0 +1,16 @@ +class Spinach::Features::AdminSettings < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + include Gitlab::CurrentSettings + + step 'I disable gravatars and save form' do + uncheck 'Gravatar enabled' + click_button 'Save' + end + + step 'I should be see gravatar disabled' do + current_application_settings.gravatar_enabled.should be_false + page.should have_content 'Application settings saved successfully' + end +end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index e657fceb704..689b297dffc 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -167,6 +167,10 @@ module SharedPaths visit admin_teams_path end + step 'I visit admin settings page' do + visit admin_application_settings_path + end + # ---------------------------------------- # Generic Project # ---------------------------------------- -- cgit v1.2.1 From f891ababeb3f1ac90c65596bd5bae50fd56aa66b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 10 Jan 2015 21:42:16 -0800 Subject: Fix randomly failing test --- features/steps/project/merge_requests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 84f1ebc003b..5d8247a2ccc 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -269,7 +269,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see comments on the side-by-side diff page' do - within '.files [id^=diff]:nth-child(1) .note-text' do + within '.files [id^=diff]:nth-child(1) .parallel .note-text' do page.should have_visible_content "Line is correct" end end -- cgit v1.2.1 From 1e45ba7f169781d7c1d79fdfcee14760558db253 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 14 Jan 2015 16:23:20 -0800 Subject: Fix tests --- features/steps/shared/issuable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index 41db2612f26..66206cac430 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -2,7 +2,7 @@ module SharedIssuable include Spinach::DSL def edit_issuable - find(:css, '.issuable-edit').click + find(:css, '.issuable-edit').trigger('click') end step 'I click link "Edit" for the merge request' do -- cgit v1.2.1 From 36acf5b29318ff5f680dbfa3525e80a153b91a33 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 14 Jan 2015 17:22:48 -0800 Subject: Revert "Fix tests" This reverts commit 1e45ba7f169781d7c1d79fdfcee14760558db253. --- features/steps/shared/issuable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index 66206cac430..41db2612f26 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -2,7 +2,7 @@ module SharedIssuable include Spinach::DSL def edit_issuable - find(:css, '.issuable-edit').trigger('click') + find(:css, '.issuable-edit').click end step 'I click link "Edit" for the merge request' do -- cgit v1.2.1 From b79ada97bb8e85c85472e0cee269a28c0e6d5ef7 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 15 Jan 2015 14:02:09 +0100 Subject: Remove password strength indicator We were having the following issues: - the indicator would sometimes stay red even if the password that was entered was long enough; - the indicator had a middle yellow signal: what does that mean? - the red/green backgrounds were not color-blind-friendly. --- features/steps/profile/profile.rb | 42 ++++----------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) (limited to 'features/steps') diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 29fc7e68dac..a907b0b7dcf 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -58,34 +58,16 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I try change my password w/o old one' do within '.update-password' do - fill_in "user_password_profile", with: "22233344" + fill_in "user_password", with: "22233344" fill_in "user_password_confirmation", with: "22233344" click_button "Save" end end - step 'I try to set a weak password' do - within '.update-password' do - fill_in "user_password_profile", with: "22233344" - end - end - - step 'I try to set a short password' do - within '.update-password' do - fill_in "user_password_profile", with: "short" - end - end - - step 'I try to set a strong password' do - within '.update-password' do - fill_in "user_password_profile", with: "Itulvo9z8uud%$" - end - end - step 'I change my password' do within '.update-password' do fill_in "user_current_password", with: "12345678" - fill_in "user_password_profile", with: "22233344" + fill_in "user_password", with: "22233344" fill_in "user_password_confirmation", with: "22233344" click_button "Save" end @@ -94,7 +76,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I unsuccessfully change my password' do within '.update-password' do fill_in "user_current_password", with: "12345678" - fill_in "user_password_profile", with: "password" + fill_in "user_password", with: "password" fill_in "user_password_confirmation", with: "confirmation" click_button "Save" end @@ -104,22 +86,6 @@ class Spinach::Features::Profile < Spinach::FeatureSteps page.should have_content "You must provide a valid current password" end - step 'I should see the input field yellow' do - page.should have_css 'div.has-warning' - end - - step 'I should see the input field green' do - page.should have_css 'div.has-success' - end - - step 'I should see the input field red' do - page.should have_css 'div.has-error' - end - - step 'I should see the password error message' do - page.should have_content 'Your password is too short' - end - step "I should see a password error message" do page.should have_content "Password confirmation doesn't match" end @@ -180,7 +146,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I submit new password' do fill_in :user_current_password, with: '12345678' - fill_in :user_password_profile, with: '12345678' + fill_in :user_password, with: '12345678' fill_in :user_password_confirmation, with: '12345678' click_button "Set new password" end -- cgit v1.2.1 From 9c0d241e27044ab326d3fcce84b10c5f9db09044 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 16 Jan 2015 08:47:58 -0800 Subject: Fix tests --- features/steps/project/merge_requests.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 5d8247a2ccc..071ef75dc62 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -194,13 +194,13 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I click link "Hide inline discussion" of the second file' do within '.files [id^=diff]:nth-child(2)' do - click_link "Diff comments" + click_link 'Show/Hide comments' end end step 'I click link "Show inline discussion" of the second file' do within '.files [id^=diff]:nth-child(2)' do - click_link "Diff comments" + click_link 'Show/Hide comments' end end -- cgit v1.2.1 From e7f772550c5fad5761777b76f97726be84693746 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 16 Jan 2015 16:09:20 -0800 Subject: Add tests to home page url redirect --- features/steps/admin/settings.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index e8168e85def..c2d0d2a3fa3 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -4,13 +4,15 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps include SharedAdmin include Gitlab::CurrentSettings - step 'I disable gravatars and save form' do + step 'I modify settings and save form' do uncheck 'Gravatar enabled' + fill_in 'Home page url', with: 'https://about.gitlab.com/' click_button 'Save' end - step 'I should be see gravatar disabled' do + step 'I should see application settings saved' do current_application_settings.gravatar_enabled.should be_false + current_application_settings.home_page_url.should == 'https://about.gitlab.com/' page.should have_content 'Application settings saved successfully' end end -- cgit v1.2.1 From 1809b3ee36b38cd47504114dfb1fed53206ebd15 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Mon, 19 Jan 2015 11:18:00 -0800 Subject: Spinach for admin applications --- features/steps/admin/applications.rb | 55 ++++++++++++++++++++++++++++++++++++ features/steps/shared/paths.rb | 4 +++ 2 files changed, 59 insertions(+) create mode 100644 features/steps/admin/applications.rb (limited to 'features/steps') diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb new file mode 100644 index 00000000000..d59088fa3c3 --- /dev/null +++ b/features/steps/admin/applications.rb @@ -0,0 +1,55 @@ +class Spinach::Features::AdminApplications < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step 'I click on new application button' do + click_on 'New Application' + end + + step 'I should see application form' do + page.should have_content "New application" + end + + step 'I fill application form out and submit' do + fill_in :doorkeeper_application_name, with: 'test' + fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' + click_on "Submit" + end + + step 'I see application' do + page.should have_content "Application: test" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click edit' do + click_on "Edit" + end + + step 'I see edit application form' do + page.should have_content "Edit application" + end + + step 'I change name of application and submit' do + page.should have_content "Edit application" + fill_in :doorkeeper_application_name, with: 'test_changed' + click_on "Submit" + end + + step 'I see that application was changed' do + page.should have_content "test_changed" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click to remove application' do + within '.oauth-applications' do + click_on "Destroy" + end + end + + step "I see that application is removed" do + page.find(".oauth-applications").should_not have_content "test_changed" + end +end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 689b297dffc..33ef6ccacf1 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -171,6 +171,10 @@ module SharedPaths visit admin_application_settings_path end + step 'I visit applications page' do + visit admin_applications_path + end + # ---------------------------------------- # Generic Project # ---------------------------------------- -- cgit v1.2.1 From 42bac7f9f27b0e8fb113e452fc2106882262172d Mon Sep 17 00:00:00 2001 From: Steven Thonus Date: Sat, 25 Jan 2014 18:15:44 +0100 Subject: adding avatar to project settings page added avatar removal show project avatar on dashboard, projects page, project page added rspec and feature tests added project avatar from repository new default project icon added added copying af avatar to forking of project added generated icon fixed avatar fork hound fix style fix test fix --- features/steps/project/project.rb | 47 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 5e7312d90ff..455539d7471 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -17,12 +17,53 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'change project path settings' do - fill_in "project_path", with: "new-path" - click_button "Rename" + fill_in 'project_path', with: 'new-path' + click_button 'Rename' end step 'I should see project with new path settings' do - project.path.should == "new-path" + project.path.should == 'new-path' + end + + step 'I change the project avatar' do + attach_file( + :project_avatar, + File.join(Rails.root, 'public', 'gitlab_logo.png') + ) + click_button 'Save changes' + @project.reload + end + + step 'I should see new project avatar' do + @project.avatar.should be_instance_of AttachmentUploader + url = @project.avatar.url + url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" + end + + step 'I should see the "Remove avatar" button' do + page.should have_link('Remove avatar') + end + + step 'I have an project avatar' do + attach_file( + :project_avatar, + File.join(Rails.root, 'public', 'gitlab_logo.png') + ) + click_button 'Save changes' + @project.reload + end + + step 'I remove my project avatar' do + click_link 'Remove avatar' + @project.reload + end + + step 'I should see the default project avatar' do + @project.avatar?.should be_false + end + + step 'I should not see the "Remove avatar" button' do + page.should_not have_link('Remove avatar') end step 'I should see project "Shop" version' do -- cgit v1.2.1 From 70c44a0da2bdeead90a99fe79e7c047d38b8ca5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Rosen=C3=B6gger?= <123haynes@gmail.com> Date: Mon, 19 Jan 2015 21:37:20 +0100 Subject: Fix tests, merge conflicts, some minor issues and make the project avatar feature mergable --- features/steps/project/project.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 455539d7471..033d45e0253 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -68,7 +68,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I should see project "Shop" version' do within '.project-side' do - page.should have_content "Version: 6.7.0.pre" + page.should have_content 'Version: 6.7.0.pre' end end @@ -86,12 +86,12 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project "Forum" README' do - page.should have_link "README.md" - page.should have_content "Sample repo for testing gitlab features" + page.should have_link 'README.md' + page.should have_content 'Sample repo for testing gitlab features' end step 'I should see project "Shop" README' do - page.should have_link "README.md" - page.should have_content "testme" + page.should have_link 'README.md' + page.should have_content 'testme' end end -- cgit v1.2.1 From ed9137862773c8cd242e16a7945cf18a0b2e1ff9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 26 Jan 2015 15:12:13 -0800 Subject: Fix blob controller rendering in case of errors --- features/steps/shared/paths.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 33ef6ccacf1..cef48c179b2 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -284,11 +284,11 @@ module SharedPaths end step 'I am on the new file page' do - current_path.should eq(project_new_tree_path(@project, root_ref)) + current_path.should eq(project_create_blob_path(@project, root_ref)) end step 'I am on the ".gitignore" edit file page' do - current_path.should eq(project_edit_tree_path( + current_path.should eq(project_edit_blob_path( @project, File.join(root_ref, '.gitignore'))) end -- cgit v1.2.1 From 9b5b334a798233b200318ecfbff55f0284f874da Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 26 Jan 2015 16:04:08 -0800 Subject: Remove unused feature steps. --- features/steps/project/issue_tracker.rb | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 features/steps/project/issue_tracker.rb (limited to 'features/steps') diff --git a/features/steps/project/issue_tracker.rb b/features/steps/project/issue_tracker.rb deleted file mode 100644 index e1700292701..00000000000 --- a/features/steps/project/issue_tracker.rb +++ /dev/null @@ -1,31 +0,0 @@ -class Spinach::Features::ProjectIssueTracker < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'project "Shop" has issues enabled' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", namespace: @user.namespace) - @project.issues_enabled = true - end - - step 'change the issue tracker to "GitLab"' do - select 'GitLab', from: 'project_issues_tracker' - end - - step 'I the project should have "GitLab" as issue tracker' do - find_field('project_issues_tracker').value.should == 'gitlab' - end - - step 'change the issue tracker to "Redmine"' do - select 'Redmine', from: 'project_issues_tracker' - end - - step 'I the project should have "Redmine" as issue tracker' do - find_field('project_issues_tracker').value.should == 'redmine' - end - - step 'I save project' do - click_button 'Save changes' - end -end -- cgit v1.2.1 From 90ba3a385cda545a58b3bb7893898bc16e982a73 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 26 Jan 2015 16:08:59 -0800 Subject: Fix tests for blobs refactoring --- features/steps/project/source/browse_files.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 805e6ff0eac..1caad73654b 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -78,7 +78,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I click link "Diff"' do - click_link 'Diff' + click_link 'Preview changes' end step 'I click on "Commit Changes"' do -- cgit v1.2.1 From 65e88f1e1aa247c9a89af82717aae791786ad276 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 26 Jan 2015 22:39:48 -0800 Subject: Fixed few tests and improved css style --- features/steps/project/source/browse_files.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 1caad73654b..bd1ca55a20a 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -58,7 +58,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I can edit code' do set_new_content - evaluate_script('editor.getValue()').should == new_gitignore_content + evaluate_script('blob.editor.getValue()').should == new_gitignore_content end step 'I edit code' do @@ -103,7 +103,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I can see new file page' do page.should have_content "New file" - page.should have_content "File name" page.should have_content "Commit message" end @@ -170,7 +169,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps private def set_new_content - execute_script("editor.setValue('#{new_gitignore_content}')") + execute_script("blob.editor.setValue('#{new_gitignore_content}')") end # Content of the gitignore file on the seed repository. -- cgit v1.2.1 From e956066d4a9c3f556a52f80acfb5c761aede7c6c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 27 Jan 2015 12:19:32 -0800 Subject: Add tests for initializing bare repo and creating new file in it --- features/steps/project/source/browse_files.rb | 11 +++++++++++ features/steps/shared/project.rb | 4 ++++ 2 files changed, 15 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index bd1ca55a20a..770e8162497 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -166,6 +166,17 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content('Your changes could not be committed') end + step 'I create bare repo' do + click_link 'Create empty bare repository' + end + + step 'I click on "add a file" link' do + click_link 'add a file' + + # Remove pre-receive hook so we can push without auth + FileUtils.rm(File.join(Project.last.repository.path, 'hooks', 'pre-receive')) + end + private def set_new_content diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 0bd5653538c..cf0be256231 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -28,6 +28,10 @@ module SharedProject @project.team << [@user, :master] end + step 'I visit my empty project page' do + visit project_path(Project.find_by(name: 'Empty Project')) + end + step 'project "Shop" has push event' do @project = Project.find_by(name: "Shop") -- cgit v1.2.1 From b076d8cddb37ea7ae24cd035967cba885cdc429d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 28 Jan 2015 15:36:12 -0800 Subject: Fix test for merge request --- features/steps/project/merge_requests.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 071ef75dc62..6f421de1aba 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -173,7 +173,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps merge!: true, ) - click_button "Accept Merge Request" + within '.can_be_merged' do + click_button "Accept Merge Request" + end end step 'I should see merged request' do -- cgit v1.2.1 From b4d9ceb26fc4bd9125cdbd6796a618415d8f6af7 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 29 Jul 2014 17:41:55 +0200 Subject: Add Asana service Also add ability to render "service.help" in markdown --- features/steps/project/services.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 09e86447058..9e8b7cf1e89 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -16,6 +16,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps page.should have_content 'Pushover' page.should have_content 'Atlassian Bamboo' page.should have_content 'JetBrains TeamCity' + page.should have_content 'Asana' end step 'I click gitlab-ci service link' do @@ -102,6 +103,20 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps find_field('Token').value.should == 'verySecret' end + step 'I click Asana service link' do + click_link 'Asana' + end + + step 'I fill Asana settings' do + check 'Active' + fill_in 'Api key', with: 'verySecret' + click_button 'Save' + end + + step 'I should see Asana service settings saved' do + find_field('Api key').value.should == 'verySecret' + end + step 'I click email on push service link' do click_link 'Emails on push' end -- cgit v1.2.1 From 3cd1eda5a4f8e4ac95ebab558e8965724481dd97 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 16 Jan 2015 12:49:50 +0100 Subject: Add restrict_to_branch to service controller And add restrict_to_branch to spec --- features/steps/project/services.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'features/steps') diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 9e8b7cf1e89..957a16d06a8 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -110,11 +110,13 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps step 'I fill Asana settings' do check 'Active' fill_in 'Api key', with: 'verySecret' + fill_in 'Restrict to branch', with: 'master' click_button 'Save' end step 'I should see Asana service settings saved' do find_field('Api key').value.should == 'verySecret' + find_field('Restrict to branch').value.should == 'master' end step 'I click email on push service link' do -- cgit v1.2.1 From 7b233ea853df7c13be688c0e47636d2750453f31 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Tue, 3 Feb 2015 16:55:31 -0800 Subject: Spelling improvement, add in a group, not into group. --- features/steps/admin/groups.rb | 2 +- features/steps/groups.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb index 4171398e568..5e45063b4b5 100644 --- a/features/steps/admin/groups.rb +++ b/features/steps/admin/groups.rb @@ -41,7 +41,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps within "#new_team_member" do select "Reporter", from: "access_level" end - click_button "Add users into group" + click_button "Add users to group" end step 'I should see "John Doe" in team list in every project as "Reporter"' do diff --git a/features/steps/groups.rb b/features/steps/groups.rb index f09d751dba3..895ee7ba081 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -34,7 +34,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps select2(user.id, from: "#user_ids", multiple: true) select "Reporter", from: "access_level" end - click_button "Add users into group" + click_button "Add users to group" end step 'I should see user "John Doe" in team list' do -- cgit v1.2.1 From bbca6a0abd9f5559fe4abbf2cb2100a0e4717ac8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Feb 2015 19:15:05 -0800 Subject: Refactor sorting in project --- features/steps/groups.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 895ee7ba081..610e7fd3a48 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -83,7 +83,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I should be redirected to group "Samurai" page' do - current_path.should == group_path(Group.last) + current_path.should == group_path(Group.find_by(name: 'Samurai')) end step 'I should see newly created group "Samurai"' do -- cgit v1.2.1 From c5be267e40c0ba05c2a7de6a71d154f1b5161160 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Feb 2015 20:21:21 -0800 Subject: Refactor issuable sorting a bit --- features/steps/admin/groups.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb index 5e45063b4b5..6bcec48be88 100644 --- a/features/steps/admin/groups.rb +++ b/features/steps/admin/groups.rb @@ -33,7 +33,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps end step 'I should be redirected to group page' do - current_path.should == admin_group_path(Group.last) + current_path.should == admin_group_path(Group.find_by(path: 'gitlab')) end When 'I select user "John Doe" from user list as "Reporter"' do -- cgit v1.2.1 From ce0811ae5cf2c69ccf24e101b1ec1554a42e9856 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 6 Feb 2015 09:19:51 -0800 Subject: Improve tests --- features/steps/project/forked_merge_requests.rb | 8 ++++---- features/steps/project/source/browse_files.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index ccef84cdcc5..a5484ad3a00 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -70,8 +70,8 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps find("#merge_request_source_branch").value.should have_content "new_design" find("#merge_request_target_branch").value.should have_content "master" find("#merge_request_title").value.should == "New Design" - verify_commit_link(".mr_target_commit",@project) - verify_commit_link(".mr_source_commit",@forked_project) + verify_commit_link(".mr_target_commit", @project) + verify_commit_link(".mr_source_commit", @forked_project) end step 'I update the merge request title' do @@ -114,7 +114,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I fill out an invalid "Merge Request On Forked Project" merge request' do select "Select branch", from: "merge_request_target_branch" find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s - find(:select, "merge_request_target_project_id", {}).value.should == project.id.to_s + find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s find(:select, "merge_request_source_branch", {}).value.should == "" find(:select, "merge_request_target_branch", {}).value.should == "" click_button "Compare branches" @@ -125,7 +125,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'the target repository should be the original repository' do - page.should have_select("merge_request_target_project_id", selected: project.path_with_namespace) + page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace) end # Verify a link is generated against the correct project diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 770e8162497..1fe01e55aa4 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -174,7 +174,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps click_link 'add a file' # Remove pre-receive hook so we can push without auth - FileUtils.rm(File.join(Project.last.repository.path, 'hooks', 'pre-receive')) + FileUtils.rm(File.join(@project.repository.path, 'hooks', 'pre-receive')) end private -- cgit v1.2.1 From 686000446639fbf0756733c822a1ebb19e09e121 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 21:22:23 +0100 Subject: Fixed deprecation in spinach stubs Signed-off-by: Jeroen van Baarsen --- features/steps/project/redirects.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index e54637120ce..e2badccbcf4 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -17,7 +17,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps end step 'I should see project "Community" home page' do - Gitlab.config.gitlab.stub(:host).and_return("www.example.com") + Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") within '.navbar-gitlab .title' do page.should have_content 'Community' end -- cgit v1.2.1 From 421e882ea422a4a33b64f0c5d466d6b22731199c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 13 Feb 2015 13:48:27 +0100 Subject: Fix specs. --- features/steps/dashboard/dashboard.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 1826ead1d51..961f8b284b8 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -37,8 +37,8 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ) end - step 'I should see "John Doe joined project at Shop" event' do - page.should have_content "John Doe joined project at #{project.name_with_namespace}" + step 'I should see "John Doe joined project Shop" event' do + page.should have_content "John Doe joined project #{project.name_with_namespace}" end step 'user with name "John Doe" left project "Shop"' do @@ -50,8 +50,8 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ) end - step 'I should see "John Doe left project at Shop" event' do - page.should have_content "John Doe left project at #{project.name_with_namespace}" + step 'I should see "John Doe left project Shop" event' do + page.should have_content "John Doe left project #{project.name_with_namespace}" end step 'I have group with projects' do -- cgit v1.2.1 From 76aad9b76ed756ca9ba2cbcdb399c815e542b3ae Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Sat, 24 Jan 2015 11:02:58 -0700 Subject: Upgrade to Rails 4.1.9 Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers. --- features/steps/admin/projects.rb | 6 +- features/steps/dashboard/dashboard.rb | 2 +- features/steps/explore/projects.rb | 8 +- features/steps/groups.rb | 4 +- features/steps/project/archived.rb | 2 +- features/steps/project/commits/commits.rb | 6 +- features/steps/project/commits/user_lookup.rb | 4 +- features/steps/project/create.rb | 2 +- features/steps/project/deploy_keys.rb | 2 +- features/steps/project/forked_merge_requests.rb | 8 +- features/steps/project/graph.rb | 4 +- features/steps/project/hooks.rb | 4 +- features/steps/project/issues/issues.rb | 4 +- features/steps/project/issues/labels.rb | 2 +- features/steps/project/merge_requests.rb | 4 +- features/steps/project/network_graph.rb | 2 +- features/steps/project/redirects.rb | 6 +- features/steps/project/services.rb | 2 +- features/steps/project/snippets.rb | 2 +- features/steps/project/source/browse_files.rb | 17 ++-- features/steps/project/source/markdown_render.rb | 72 +++++++-------- features/steps/project/wiki.rb | 8 +- features/steps/shared/paths.rb | 110 +++++++++++------------ features/steps/shared/project.rb | 5 +- 24 files changed, 145 insertions(+), 141 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index 2fd6385fe7b..9be4d39d2d5 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -15,17 +15,17 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps step 'I should see project details' do project = Project.first - current_path.should == admin_project_path(project) + current_path.should == admin_namespace_project_path(project.namespace, project) page.should have_content(project.name_with_namespace) page.should have_content(project.creator.name) end step 'I visit admin project page' do - visit admin_project_path(project) + visit admin_namespace_project_path(project.namespace, project) end step 'I transfer project to group \'Web\'' do - find(:xpath, "//input[@id='namespace_id']").set group.id + find(:xpath, "//input[@id='new_namespace_id']").set group.id click_button 'Transfer' end diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 1826ead1d51..f9b1f18562a 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -21,7 +21,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps end step 'I see prefilled new Merge Request page' do - current_path.should == new_project_merge_request_path(@project) + current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project) find("#merge_request_target_project_id").value.should == @project.id.to_s find("#merge_request_source_branch").value.should == "fix" find("#merge_request_target_branch").value.should == "master" diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb index 8172f7922cc..26b71406bd8 100644 --- a/features/steps/explore/projects.rb +++ b/features/steps/explore/projects.rb @@ -65,7 +65,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps title: "New feature", project: public_project ) - visit project_issues_path(public_project) + visit namespace_project_issues_path(public_project.namespace, public_project) end @@ -84,7 +84,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps title: "New internal feature", project: internal_project ) - visit project_issues_path(internal_project) + visit namespace_project_issues_path(internal_project.namespace, internal_project) end @@ -95,7 +95,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps end step 'I visit "Community" merge requests page' do - visit project_merge_requests_path(public_project) + visit namespace_project_merge_requests_path(public_project.namespace, public_project) end step 'project "Community" has "Bug fix" open merge request' do @@ -112,7 +112,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps end step 'I visit "Internal" merge requests page' do - visit project_merge_requests_path(internal_project) + visit namespace_project_merge_requests_path(internal_project.namespace, internal_project) end step 'project "Internal" has "Feature implemented" open merge request' do diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 610e7fd3a48..f44afb8cbe6 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -194,8 +194,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'I should see group milestone with all issues and MRs assigned to that milestone' do page.should have_content('Milestone GL-113') page.should have_content('Progress: 0 closed – 4 open') - page.should have_link(@issue1.title, href: project_issue_path(@project1, @issue1)) - page.should have_link(@mr3.title, href: project_merge_request_path(@project3, @mr3)) + page.should have_link(@issue1.title, href: namespace_project_issue_path(@project1.namespace, @project1, @issue1)) + page.should have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3)) end protected diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb index afbf4d5950d..37ad0c77655 100644 --- a/features/steps/project/archived.rb +++ b/features/steps/project/archived.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps When 'I visit project "Forum" page' do project = Project.find_by(name: "Forum") - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I should not see "Archived"' do diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index d515ee1ac11..b2dccf868b0 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -24,7 +24,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I click on commit link' do - visit project_commit_path(@project, sample_commit.id) + visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) end step 'I see commit info' do @@ -58,7 +58,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I visit big commit page' do Commit::DIFF_SAFE_FILES = 20 - visit project_commit_path(@project, sample_big_commit.id) + visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id) end step 'I see big commit warning' do @@ -68,7 +68,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I visit a commit with an image that changed' do - visit project_commit_path(@project, sample_image_commit.id) + visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) end step 'The diff links to both the previous and current image' do diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb index 0622fef43bb..63ff84c82ef 100644 --- a/features/steps/project/commits/user_lookup.rb +++ b/features/steps/project/commits/user_lookup.rb @@ -4,11 +4,11 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps include SharedPaths step 'I click on commit link' do - visit project_commit_path(@project, sample_commit.id) + visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) end step 'I click on another commit link' do - visit project_commit_path(@project, sample_commit.parent_id) + visit namespace_project_commit_path(@project.namespace, @project, sample_commit.parent_id) end step 'I have user with primary email' do diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 6b07b62f16f..6b85cf74f5f 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -9,7 +9,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'I should see project page' do page.should have_content "Empty" - current_path.should == project_path(Project.last) + current_path.should == namespace_project_path(Project.last.namespace, Project.last) end step 'I should see empty project instuctions' do diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 914da31322f..4bf5cb5fa40 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -24,7 +24,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should be on deploy keys page' do - current_path.should == project_deploy_keys_path(@project) + current_path.should == namespace_project_deploy_keys_path(@project.namespace, @project) end step 'I should see newly created deploy key' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index a5484ad3a00..63ad90e1241 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -23,7 +23,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I should see merge request "Merge Request On Forked Project"' do @project.merge_requests.size.should >= 1 @merge_request = @project.merge_requests.last - current_path.should == project_merge_request_path(@project, @merge_request) + current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) @merge_request.title.should == "Merge Request On Forked Project" @merge_request.source_project.should == @forked_project @merge_request.source_branch.should == "fix" @@ -64,7 +64,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see prefilled new Merge Request page for the forked project' do - current_path.should == new_project_merge_request_path(@forked_project) + current_path.should == new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) find("#merge_request_source_project_id").value.should == @forked_project.id.to_s find("#merge_request_target_project_id").value.should == @project.id.to_s find("#merge_request_source_branch").value.should have_content "new_design" @@ -86,7 +86,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps page.should have_content "An Edited Forked Merge Request" @project.merge_requests.size.should >= 1 @merge_request = @project.merge_requests.last - current_path.should == project_merge_request_path(@project, @merge_request) + current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) @merge_request.source_project.should == @forked_project @merge_request.source_branch.should == "fix" @merge_request.target_branch.should == "master" @@ -106,7 +106,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - current_path.should == edit_project_merge_request_path(@project, @merge_request) + current_path.should == edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) page.should have_content "Edit merge request ##{@merge_request.id}" find("#merge_request_title").value.should == "Merge Request On Forked Project" end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb index ba460ac8097..bc07c3d413c 100644 --- a/features/steps/project/graph.rb +++ b/features/steps/project/graph.rb @@ -8,12 +8,12 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps When 'I visit project "Shop" graph page' do project = Project.find_by(name: "Shop") - visit project_graph_path(project, "master") + visit namespace_project_graph_path(project.namespace, project, "master") end step 'I visit project "Shop" commits graph page' do project = Project.find_by(name: "Shop") - visit commits_project_graph_path(project, "master") + visit commits_namespace_project_graph_path(project.namespace, project, "master") end step 'page should have commits graphs' do diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index f4b8d372be8..4b135202593 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -29,7 +29,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I should see newly created hook' do - current_path.should == project_hooks_path(current_project) + current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) page.should have_content(@url) end @@ -44,7 +44,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'hook should be triggered' do - current_path.should == project_hooks_path(current_project) + current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) page.should have_selector '.flash-notice', text: 'Hook successfully executed.' end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index c0ae5208541..6d72c93ad13 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -168,7 +168,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When 'I visit empty project page' do project = Project.find_by(name: 'Empty Project') - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I see empty project details with ssh clone info' do @@ -180,7 +180,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When "I visit empty project's issues page" do project = Project.find_by(name: 'Empty Project') - visit project_issues_path(project) + visit namespace_project_issues_path(project.namespace, project) end step 'I leave a comment with code block' do diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 3e3e90824b4..6ce34c500c6 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps include SharedPaths step 'I visit \'bug\' label edit page' do - visit edit_project_label_path(project, bug_label) + visit edit_namespace_project_label_path(project.namespace, project, bug_label) end step 'I remove label \'bug\'' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 6f421de1aba..e477444023d 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -101,11 +101,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I switch to the diff tab' do - visit diffs_project_merge_request_path(project, merge_request) + visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) end step 'I switch to the merge request\'s comments tab' do - visit project_merge_request_path(project, merge_request) + visit namespace_project_merge_request_path(project.namespace, project, merge_request) end step 'I click on the commit in the merge request' do diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb index 14fdc72b8b6..a15688ace6a 100644 --- a/features/steps/project/network_graph.rb +++ b/features/steps/project/network_graph.rb @@ -12,7 +12,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps Network::Graph.stub(max_count: 10) project = Project.find_by(name: "Shop") - visit project_network_path(project, "master") + visit namespace_project_network_path(project.namespace, project, "master") end step 'page should select "master" in select box' do diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index e2badccbcf4..57c6e39c801 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -13,7 +13,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Community" page' do project = Project.find_by(name: 'Community') - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I should see project "Community" home page' do @@ -25,12 +25,12 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Enterprise" page' do project = Project.find_by(name: 'Enterprise') - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I visit project "CommunityDoesNotExist" page' do project = Project.find_by(name: 'Community') - visit project_path(project) + 'DoesNotExist' + visit namespace_project_path(project.namespace, project) + 'DoesNotExist' end step 'I click on "Sign In"' do diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 957a16d06a8..3307117e69a 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps include SharedPaths step 'I visit project "Shop" services page' do - visit project_services_path(@project) + visit namespace_project_services_path(@project.namespace, @project) end step 'I should see list of available services' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index 4a39bfdbb79..343aeb53b11 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -86,7 +86,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I visit snippet page "Snippet one"' do - visit project_snippet_path(project, project_snippet) + visit namespace_project_snippet_path(project.namespace, project, project_snippet) end def project_snippet diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 1fe01e55aa4..98d8a60e1a5 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see files from repository for "6d39438"' do - current_path.should == project_tree_path(@project, "6d39438") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438") page.should have_content ".gitignore" page.should have_content "LICENSE" end @@ -141,21 +141,24 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - current_path.should == project_tree_path(@project, 'master') + current_path.should == namespace_project_tree_path(@project.namespace, @project, 'master') end step 'I am redirected to the ".gitignore"' do - expect(current_path).to eq(project_blob_path(@project, 'master/.gitignore')) + expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) end step 'I am redirected to the permalink URL' do - expect(current_path).to eq(project_blob_path( - @project, @project.repository.commit.sha + '/.gitignore')) + expect(current_path).to( + eq(namespace_project_blob_path(@project.namespace, @project, + @project.repository.commit.sha + + '/.gitignore')) + ) end step 'I am redirected to the new file' do - expect(current_path).to eq(project_blob_path( - @project, 'master/' + new_file_name)) + expect(current_path).to eq(namespace_project_blob_path( + @project.namespace, @project, 'master/' + new_file_name)) end step "I don't see the permalink link" do diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index 53578ee5970..7961fdedad8 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -13,7 +13,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown' do - current_path.should == project_tree_path(@project, "markdown") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") page.should have_content "README.md" page.should have_content "CHANGELOG" end @@ -33,7 +33,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") page.should have_content "All API requests require authentication" end @@ -42,7 +42,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct directory rendered' do - current_path.should == project_tree_path(@project, "markdown/doc/raketasks") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") page.should have_content "backup_restore.md" page.should have_content "maintenance.md" end @@ -52,7 +52,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct doc/api directory rendered' do - current_path.should == project_tree_path(@project, "markdown/doc/api") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") page.should have_content "README.md" page.should have_content "users.md" end @@ -62,7 +62,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct maintenance file rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/raketasks/maintenance.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" end @@ -93,7 +93,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see correct file rendered' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") page.should have_content "Contents" page.should have_link "Users" page.should have_link "Rake tasks" @@ -104,7 +104,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct document file' do - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") page.should have_content "Get a list of users." end @@ -115,100 +115,100 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps # Markdown branch When 'I visit markdown branch' do - visit project_tree_path(@project, "markdown") + visit namespace_project_tree_path(@project.namespace, @project, "markdown") end When 'I visit markdown branch "README.md" blob' do - visit project_blob_path(@project, "markdown/README.md") + visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") end When 'I visit markdown branch "d" tree' do - visit project_tree_path(@project, "markdown/d") + visit namespace_project_tree_path(@project.namespace, @project, "markdown/d") end When 'I visit markdown branch "d/README.md" blob' do - visit project_blob_path(@project, "markdown/d/README.md") + visit namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") end step 'I should see files from repository in markdown branch' do - current_path.should == project_tree_path(@project, "markdown") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") page.should have_content "README.md" page.should have_content "CHANGELOG" end step 'I see correct file rendered in markdown branch' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") page.should have_content "Contents" page.should have_link "Users" page.should have_link "Rake tasks" end step 'I should see correct document rendered for markdown branch' do - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") page.should have_content "All API requests require authentication" end step 'I should see correct directory rendered for markdown branch' do - current_path.should == project_tree_path(@project, "markdown/doc/raketasks") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") page.should have_content "backup_restore.md" page.should have_content "maintenance.md" end step 'I should see the users document file in markdown branch' do - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") page.should have_content "Get a list of users." end # Expected link contents step 'The link with text "empty" should have url "tree/markdown"' do - find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown") + find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") end step 'The link with text "empty" should have url "blob/markdown/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") end step 'The link with text "empty" should have url "tree/markdown/d"' do - find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d") + find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown/d") end step 'The link with text "empty" should have '\ 'url "blob/markdown/d/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md") + find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") end step 'The link with text "ID" should have url "tree/markdownID"' do - find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' + find('a', text: /^#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' end step 'The link with text "/ID" should have url "tree/markdownID"' do - find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' end step 'The link with text "README.mdID" '\ 'should have url "blob/markdown/README.mdID"' do - find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' + find('a', text: /^README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' end step 'The link with text "d/README.mdID" should have '\ 'url "blob/markdown/d/README.mdID"' do - find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id' + find('a', text: /^d\/README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "d/markdown/README.md") + '#id' end step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' + find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' end step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' end # Wiki step 'I go to wiki page' do click_link "Wiki" - current_path.should == project_wiki_path(@project, "home") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") end step 'I add various links to the wiki page' do @@ -218,7 +218,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'Wiki page should have added links' do - current_path.should == project_wiki_path(@project, "home") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") page.should have_content "test GitLab API doc Rake tasks" end @@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see new wiki page named test' do - current_path.should == project_wiki_path(@project, "test") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "test") page.should have_content "Editing" end When 'I go back to wiki page home' do - visit project_wiki_path(@project, "home") - current_path.should == project_wiki_path(@project, "home") + visit namespace_project_wiki_path(@project.namespace, @project, "home") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") end step 'I click on GitLab API doc link' do @@ -251,7 +251,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Gitlab API document' do - current_path.should == project_wiki_path(@project, "api") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api") page.should have_content "Editing" end @@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Rake tasks directory' do - current_path.should == project_wiki_path(@project, "raketasks") + current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks") page.should have_content "Editing" end step 'I go directory which contains README file' do - visit project_tree_path(@project, "markdown/doc/api") - current_path.should == project_tree_path(@project, "markdown/doc/api") + visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") end step 'I click on a relative link in README' do @@ -274,7 +274,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct markdown' do - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md") + current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") page.should have_content "List users" end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index aa00818c602..cd7d5eac243 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to the Edit Home Wiki page' do - current_path.should == project_wiki_path(project, :home) + current_path.should == namespace_project_wiki_path(project.namespace, project, :home) end step 'I create the Wiki Home page' do @@ -33,7 +33,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to that Wiki page' do - visit project_wiki_path(project, @page) + visit namespace_project_wiki_path(project.namespace, project, @page) end step 'I click on the Edit button' do @@ -50,7 +50,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to that Wiki page' do - current_path.should == project_wiki_path(project, @page) + current_path.should == namespace_project_wiki_path(project.namespace, project, @page) end step 'That page has two revisions' do @@ -90,7 +90,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to wiki page with images' do - visit project_wiki_path(project, @wiki_page) + visit namespace_project_wiki_path(project.namespace, project, @wiki_page) end step 'I click on existing image link' do diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index cef48c179b2..835b644e6c7 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -136,7 +136,7 @@ module SharedPaths end step 'I visit admin projects page' do - visit admin_projects_path + visit admin_namespaces_projects_path end step 'I visit admin users page' do @@ -180,59 +180,59 @@ module SharedPaths # ---------------------------------------- step "I visit my project's home page" do - visit project_path(@project) + visit namespace_project_path(@project.namespace, @project) end step "I visit my project's settings page" do - visit edit_project_path(@project) + visit edit_namespace_project_path(@project.namespace, @project) end step "I visit my project's files page" do - visit project_tree_path(@project, root_ref) + visit namespace_project_tree_path(@project.namespace, @project, root_ref) end step 'I visit a binary file in the repo' do - visit project_blob_path(@project, File.join( + visit namespace_project_blob_path(@project.namespace, @project, File.join( root_ref, 'files/images/logo-black.png')) end step "I visit my project's commits page" do - visit project_commits_path(@project, root_ref, {limit: 5}) + visit namespace_project_commits_path(@project.namespace, @project, root_ref, {limit: 5}) end step "I visit my project's commits page for a specific path" do - visit project_commits_path(@project, root_ref + "/app/models/project.rb", {limit: 5}) + visit namespace_project_commits_path(@project.namespace, @project, root_ref + "/app/models/project.rb", {limit: 5}) end step 'I visit my project\'s commits stats page' do - visit stats_project_repository_path(@project) + visit stats_namespace_project_repository_path(@project.namespace, @project) end step "I visit my project's network page" do # Stub Graph max_size to speed up test (10 commits vs. 650) Network::Graph.stub(max_count: 10) - visit project_network_path(@project, root_ref) + visit namespace_project_network_path(@project.namespace, @project, root_ref) end step "I visit my project's issues page" do - visit project_issues_path(@project) + visit namespace_project_issues_path(@project.namespace, @project) end step "I visit my project's merge requests page" do - visit project_merge_requests_path(@project) + visit namespace_project_merge_requests_path(@project.namespace, @project) end step "I visit my project's wiki page" do - visit project_wiki_path(@project, :home) + visit namespace_project_wiki_path(@project.namespace, @project, :home) end step 'I visit project hooks page' do - visit project_hooks_path(@project) + visit namespace_project_hooks_path(@project.namespace, @project) end step 'I visit project deploy keys page' do - visit project_deploy_keys_path(@project) + visit namespace_project_deploy_keys_path(@project.namespace, @project) end # ---------------------------------------- @@ -240,153 +240,153 @@ module SharedPaths # ---------------------------------------- step 'I visit project "Shop" page' do - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I visit project "Forked Shop" merge requests page' do - visit project_merge_requests_path(@forked_project) + visit namespace_project_merge_requests_path(@forked_project.namespace, @forked_project) end step 'I visit edit project "Shop" page' do - visit edit_project_path(project) + visit edit_namespace_project_path(project.namespace, project) end step 'I visit project branches page' do - visit project_branches_path(@project) + visit namespace_project_branches_path(@project.namespace, @project) end step 'I visit project protected branches page' do - visit project_protected_branches_path(@project) + visit namespace_project_protected_branches_path(@project.namespace, @project) end step 'I visit compare refs page' do - visit project_compare_index_path(@project) + visit namespace_project_compare_index_path(@project.namespace, @project) end step 'I visit project commits page' do - visit project_commits_path(@project, root_ref, {limit: 5}) + visit namespace_project_commits_path(@project.namespace, @project, root_ref, {limit: 5}) end step 'I visit project commits page for stable branch' do - visit project_commits_path(@project, 'stable', {limit: 5}) + visit namespace_project_commits_path(@project.namespace, @project, 'stable', {limit: 5}) end step 'I visit project source page' do - visit project_tree_path(@project, root_ref) + visit namespace_project_tree_path(@project.namespace, @project, root_ref) end step 'I visit blob file from repo' do - visit project_blob_path(@project, File.join(sample_commit.id, sample_blob.path)) + visit namespace_project_blob_path(@project.namespace, @project, File.join(sample_commit.id, sample_blob.path)) end step 'I visit ".gitignore" file in repo' do - visit project_blob_path(@project, File.join(root_ref, '.gitignore')) + visit namespace_project_blob_path(@project.namespace, @project, File.join(root_ref, '.gitignore')) end step 'I am on the new file page' do - current_path.should eq(project_create_blob_path(@project, root_ref)) + current_path.should eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) end step 'I am on the ".gitignore" edit file page' do - current_path.should eq(project_edit_blob_path( - @project, File.join(root_ref, '.gitignore'))) + current_path.should eq(namespace_project_edit_blob_path( + @project.namespace, @project, File.join(root_ref, '.gitignore'))) end step 'I visit project source page for "6d39438"' do - visit project_tree_path(@project, "6d39438") + visit namespace_project_tree_path(@project.namespace, @project, "6d39438") end step 'I visit project source page for' \ ' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do - visit project_tree_path(@project, + visit namespace_project_tree_path(@project.namespace, @project, '6d394385cf567f80a8fd85055db1ab4c5295806f') end step 'I visit project tags page' do - visit project_tags_path(@project) + visit namespace_project_tags_path(@project.namespace, @project) end step 'I visit project commit page' do - visit project_commit_path(@project, sample_commit.id) + visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) end step 'I visit project "Shop" issues page' do - visit project_issues_path(project) + visit namespace_project_issues_path(project.namespace, project) end step 'I visit issue page "Release 0.4"' do issue = Issue.find_by(title: "Release 0.4") - visit project_issue_path(issue.project, issue) + visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) end step 'I visit issue page "Tasks-open"' do issue = Issue.find_by(title: 'Tasks-open') - visit project_issue_path(issue.project, issue) + visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) end step 'I visit issue page "Tasks-closed"' do issue = Issue.find_by(title: 'Tasks-closed') - visit project_issue_path(issue.project, issue) + visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) end step 'I visit project "Shop" labels page' do project = Project.find_by(name: 'Shop') - visit project_labels_path(project) + visit namespace_project_labels_path(project.namespace, project) end step 'I visit project "Forum" labels page' do project = Project.find_by(name: 'Forum') - visit project_labels_path(project) + visit namespace_project_labels_path(project.namespace, project) end step 'I visit project "Shop" new label page' do project = Project.find_by(name: 'Shop') - visit new_project_label_path(project) + visit new_namespace_project_label_path(project.namespace, project) end step 'I visit project "Forum" new label page' do project = Project.find_by(name: 'Forum') - visit new_project_label_path(project) + visit new_namespace_project_label_path(project.namespace, project) end step 'I visit merge request page "Bug NS-04"' do mr = MergeRequest.find_by(title: "Bug NS-04") - visit project_merge_request_path(mr.target_project, mr) + visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) end step 'I visit merge request page "Bug NS-05"' do mr = MergeRequest.find_by(title: "Bug NS-05") - visit project_merge_request_path(mr.target_project, mr) + visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) end step 'I visit merge request page "MR-task-open"' do mr = MergeRequest.find_by(title: 'MR-task-open') - visit project_merge_request_path(mr.target_project, mr) + visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) end step 'I visit merge request page "MR-task-closed"' do mr = MergeRequest.find_by(title: 'MR-task-closed') - visit project_merge_request_path(mr.target_project, mr) + visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) end step 'I visit project "Shop" merge requests page' do - visit project_merge_requests_path(project) + visit namespace_project_merge_requests_path(project.namespace, project) end step 'I visit forked project "Shop" merge requests page' do - visit project_merge_requests_path(project) + visit namespace_project_merge_requests_path(project.namespace, project) end step 'I visit project "Shop" milestones page' do - visit project_milestones_path(project) + visit namespace_project_milestones_path(project.namespace, project) end step 'I visit project "Shop" team page' do - visit project_team_index_path(project) + visit namespace_project_team_index_path(project.namespace, project) end step 'I visit project wiki page' do - visit project_wiki_path(@project, :home) + visit namespace_project_wiki_path(@project.namespace, @project, :home) end # ---------------------------------------- @@ -395,22 +395,22 @@ module SharedPaths step 'I visit project "Community" page' do project = Project.find_by(name: "Community") - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I visit project "Community" source page' do project = Project.find_by(name: 'Community') - visit project_tree_path(project, root_ref) + visit namespace_project_tree_path(project.namespace, project, root_ref) end step 'I visit project "Internal" page' do project = Project.find_by(name: "Internal") - visit project_path(project) + visit namespace_project_path(project.namespace, project) end step 'I visit project "Enterprise" page' do project = Project.find_by(name: "Enterprise") - visit project_path(project) + visit namespace_project_path(project.namespace, project) end # ---------------------------------------- @@ -419,7 +419,7 @@ module SharedPaths step "I visit empty project page" do project = Project.find_by(name: "Empty Public Project") - visit project_path(project) + visit namespace_project_path(project.namespace, project) end # ---------------------------------------- @@ -447,7 +447,7 @@ module SharedPaths # ---------------------------------------- step 'I visit project "Shop" snippets page' do - visit project_snippets_path(project) + visit namespace_project_snippets_path(project.namespace, project) end step 'I visit snippets page' do diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index cf0be256231..41f71ae29cb 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -29,7 +29,8 @@ module SharedProject end step 'I visit my empty project page' do - visit project_path(Project.find_by(name: 'Empty Project')) + project = Project.find_by(name: 'Empty Project') + visit namespace_project_path(project.namespace, project) end step 'project "Shop" has push event' do @@ -64,7 +65,7 @@ module SharedProject end step 'I should see project settings' do - current_path.should == edit_project_path(@project) + current_path.should == edit_namespace_project_path(@project.namespace, @project) page.should have_content("Project name") page.should have_content("Features:") end -- cgit v1.2.1 From 7d5f86f6cbd187e75a6ba164ad6bfd036977dd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Rosen=C3=B6gger?= Date: Mon, 9 Feb 2015 14:35:48 +0100 Subject: Fix broken access control and refactor avatar upload This commit moves the note folder from /public/uploads/note to /uploads/note and changes the uploader accordingly. Now it's no longer possible to avoid the access control by modifing the url. The Avatar upload has been refactored to use an own uploader as well to cleanly seperate the two upload types. --- features/steps/groups.rb | 2 +- features/steps/profile/profile.rb | 2 +- features/steps/project/project.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 610e7fd3a48..0a9b4ccba53 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -110,7 +110,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I should see new group "Owned" avatar' do - Group.find_by(name: "Owned").avatar.should be_instance_of AttachmentUploader + Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index a907b0b7dcf..4efd2176782 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -29,7 +29,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see new avatar' do - @user.avatar.should be_instance_of AttachmentUploader + @user.avatar.should be_instance_of AvatarUploader @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 033d45e0253..d39c8e7d2db 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -35,7 +35,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see new project avatar' do - @project.avatar.should be_instance_of AttachmentUploader + @project.avatar.should be_instance_of AvatarUploader url = @project.avatar.url url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" end -- cgit v1.2.1 From 080449f8af56e1aa0d80c921d0bc6ea4a61f1c38 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 13 Feb 2015 14:14:27 +0100 Subject: Make sure Markdown previews always use the same styling as the eventual destination. --- features/steps/project/merge_requests.rb | 4 ++-- features/steps/shared/note.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 6f421de1aba..c97c3075c53 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -253,7 +253,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should still see a comment like "Line is correct" in the first file' do - within '.files [id^=diff]:nth-child(1) .note-text' do + within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do page.should have_visible_content "Line is correct" end end @@ -271,7 +271,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see comments on the side-by-side diff page' do - within '.files [id^=diff]:nth-child(1) .parallel .note-text' do + within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do page.should have_visible_content "Line is correct" end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 625bcc0b266..45773056953 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -116,7 +116,7 @@ module SharedNote end step 'The comment with the header should not have an ID' do - within(".note-text") do + within(".note-body > .note-text") do page.should have_content("Comment with a header") page.should_not have_css("#comment-with-a-header") end -- cgit v1.2.1 From 8184a6564454faf0f9ae9dfee1377c3407d08447 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 19 Feb 2015 08:57:35 -0800 Subject: Revert "Fix broken access control and refactor avatar upload" This reverts commit 7d5f86f6cbd187e75a6ba164ad6bfd036977dd07. --- features/steps/groups.rb | 2 +- features/steps/profile/profile.rb | 2 +- features/steps/project/project.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 0a9b4ccba53..610e7fd3a48 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -110,7 +110,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I should see new group "Owned" avatar' do - Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader + Group.find_by(name: "Owned").avatar.should be_instance_of AttachmentUploader Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 4efd2176782..a907b0b7dcf 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -29,7 +29,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see new avatar' do - @user.avatar.should be_instance_of AvatarUploader + @user.avatar.should be_instance_of AttachmentUploader @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index d39c8e7d2db..033d45e0253 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -35,7 +35,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see new project avatar' do - @project.avatar.should be_instance_of AvatarUploader + @project.avatar.should be_instance_of AttachmentUploader url = @project.avatar.url url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" end -- cgit v1.2.1 From 6a6a33452288542aa93354f6ce5a7720721e0688 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 19 Feb 2015 17:24:34 -0800 Subject: Fix active tab tests --- features/steps/project/active_tab.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index bb42d15eae5..dd3215adb1a 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -93,11 +93,11 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ensure_active_sub_tab('Issues') end - step 'the active sub tab should be Milestones' do - ensure_active_sub_tab('Milestones') + step 'the active main tab should be Milestones' do + ensure_active_main_tab('Milestones') end - step 'the active sub tab should be Labels' do - ensure_active_sub_tab('Labels') + step 'the active main tab should be Labels' do + ensure_active_main_tab('Labels') end end -- cgit v1.2.1 From 4ef6ffaad3e9b7a29b438722e5e101de78521ec7 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 20 Feb 2015 15:19:50 +0100 Subject: Split up AttachmentUploader. --- features/steps/groups.rb | 2 +- features/steps/profile/profile.rb | 2 +- features/steps/project/project.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 610e7fd3a48..0a9b4ccba53 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -110,7 +110,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I should see new group "Owned" avatar' do - Group.find_by(name: "Owned").avatar.should be_instance_of AttachmentUploader + Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index a907b0b7dcf..4efd2176782 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -29,7 +29,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see new avatar' do - @user.avatar.should be_instance_of AttachmentUploader + @user.avatar.should be_instance_of AvatarUploader @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 033d45e0253..d39c8e7d2db 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -35,7 +35,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see new project avatar' do - @project.avatar.should be_instance_of AttachmentUploader + @project.avatar.should be_instance_of AvatarUploader url = @project.avatar.url url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" end -- cgit v1.2.1 From 12589d339070d86b57a4f97778a48b1b9cc5a0a1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 23 Feb 2015 18:43:39 -0800 Subject: Improve sidebar menu for project settings --- features/steps/shared/project_tab.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index 6aa4f1b20df..c5aed19331c 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -41,6 +41,8 @@ module SharedProjectTab end step 'the active main tab should be Settings' do - ensure_active_main_tab('Settings') + within '.nav-sidebar' do + page.should have_content('Back to project') + end end end -- cgit v1.2.1 From 3177693c6f47fda14f84abf0b8f694aec3e076fc Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Mon, 23 Feb 2015 21:00:30 +0200 Subject: WebEditor: save to new branch: spinach --- features/steps/project/source/browse_files.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 98d8a60e1a5..557555aee58 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -69,6 +69,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps fill_in :file_name, with: new_file_name end + step 'I fill the new branch name' do + fill_in :new_branch, with: 'new_branch_name' + end + step 'I fill the new file name with an illegal name' do fill_in :file_name, with: '.git' end @@ -148,6 +152,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) end + step 'I am redirected to the ".gitignore" on new branch' do + expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/.gitignore')) + end + step 'I am redirected to the permalink URL' do expect(current_path).to( eq(namespace_project_blob_path(@project.namespace, @project, @@ -161,6 +169,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps @project.namespace, @project, 'master/' + new_file_name)) end + step 'I am redirected to the new file on new branch' do + expect(current_path).to eq(namespace_project_blob_path( + @project.namespace, @project, 'new_branch_name/' + new_file_name)) + end + step "I don't see the permalink link" do expect(page).not_to have_link('permalink') end @@ -177,7 +190,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps click_link 'add a file' # Remove pre-receive hook so we can push without auth - FileUtils.rm(File.join(@project.repository.path, 'hooks', 'pre-receive')) + FileUtils.rm_f(File.join(@project.repository.path, 'hooks', 'pre-receive')) end private -- cgit v1.2.1 From 9c4337e58bf8a5e2c9085a1f4eff0e942d659d2d Mon Sep 17 00:00:00 2001 From: Sabba Petri Date: Tue, 24 Feb 2015 10:01:41 -0800 Subject: Fixed tests Tests expected specific string capitalization for headers. --- features/steps/profile/notifications.rb | 2 +- features/steps/profile/profile.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'features/steps') diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb index df96dddd06e..13e93618eb7 100644 --- a/features/steps/profile/notifications.rb +++ b/features/steps/profile/notifications.rb @@ -7,6 +7,6 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps end step 'I should see global notifications settings' do - page.should have_content "Notifications settings" + page.should have_content "Notifications Settings" end end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index a907b0b7dcf..3cba2ae1008 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -3,7 +3,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps include SharedPaths step 'I should see my profile info' do - page.should have_content "Profile settings" + page.should have_content "Profile Settings" end step 'I change my profile info' do -- cgit v1.2.1 From 9b8d5c4ab4e5dc544891f37fa6dd91134577e313 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 25 Feb 2015 10:49:51 +0100 Subject: Make test element selection more specific. --- features/steps/project/merge_requests.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index d358f1d875f..263f2ef2438 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -213,7 +213,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see a comment like "Line is wrong" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-text' do + within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do page.should have_visible_content "Line is wrong" end end @@ -225,7 +225,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see a comment like "Line is wrong here" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-text' do + within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do page.should have_visible_content "Line is wrong here" end end @@ -238,7 +238,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Add Comment" end - within ".files [id^=diff]:nth-child(1) .note-text" do + within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do page.should have_content "Line is correct" end end -- cgit v1.2.1