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/shared/diff_note.rb | 14 +++++++------- features/steps/shared/markdown.rb | 39 ++++++++++++++++++++++++++++++++++++++ features/steps/shared/note.rb | 12 ++++++------ 3 files changed, 52 insertions(+), 13 deletions(-) (limited to 'features/steps/shared') 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/shared/diff_note.rb | 18 +++++++++--------- features/steps/shared/issuable.rb | 15 +++++++++++++++ features/steps/shared/markdown.rb | 14 +++++++------- features/steps/shared/note.rb | 12 ++++++------ 4 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 features/steps/shared/issuable.rb (limited to 'features/steps/shared') 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/shared') 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/shared') 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 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/shared') 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 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/shared/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps/shared') 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 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/shared') 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 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/shared') 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 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/shared/active_tab.rb | 8 ++++---- features/steps/shared/issuable.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'features/steps/shared') 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 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/shared') 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/shared') 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 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/shared/paths.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'features/steps/shared') 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 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/shared') 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/shared/paths.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'features/steps/shared') 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 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/shared') 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/shared') 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 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/shared/paths.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'features/steps/shared') 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 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/shared') 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 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/shared/project.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'features/steps/shared') 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 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/shared/paths.rb | 110 +++++++++++++++++++-------------------- features/steps/shared/project.rb | 5 +- 2 files changed, 58 insertions(+), 57 deletions(-) (limited to 'features/steps/shared') 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 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/shared/note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps/shared') 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 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/shared') 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