summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-04-16 08:53:27 +0000
committerRémy Coutable <remy@rymai.me>2018-04-16 08:53:27 +0000
commit36d6cc86fda41b5cf8ff43c62073ae956b6c634e (patch)
tree6451bbf34b564f2ca6c9ba70d5f76a5fcca9ad4c /features
parentc3e26860be156314e733a6dfb986c91fc55766f5 (diff)
downloadgitlab-ce-36d6cc86fda41b5cf8ff43c62073ae956b6c634e.tar.gz
Replace the `project/commits/comments.feature` spinach test with an rspec analog
Diffstat (limited to 'features')
-rw-r--r--features/project/commits/comments.feature51
-rw-r--r--features/steps/shared/note.rb122
2 files changed, 0 insertions, 173 deletions
diff --git a/features/project/commits/comments.feature b/features/project/commits/comments.feature
deleted file mode 100644
index fafb54b183a..00000000000
--- a/features/project/commits/comments.feature
+++ /dev/null
@@ -1,51 +0,0 @@
-@project_commits
-Feature: Project Commits Comments
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And I visit project commit page
-
- @javascript
- Scenario: I can comment on a commit
- Given I leave a comment like "XML attached"
- Then I should see a comment saying "XML attached"
-
- @javascript
- Scenario: I can't cancel the main form
- Then I should not see the cancel comment button
-
- @javascript
- Scenario: I can preview with text
- Given I write a comment like ":+1: Nice"
- Then The comment preview tab should be display rendered Markdown
-
- @javascript
- Scenario: I preview a comment
- Given I preview a comment text like "Bug fixed :smile:"
- Then I should see the comment preview
- And I should not see the comment text field
-
- @javascript
- Scenario: I can edit after preview
- Given I preview a comment text like "Bug fixed :smile:"
- Then I should see the comment write tab
-
- @javascript
- Scenario: I have a reset form after posting from preview
- Given I preview a comment text like "Bug fixed :smile:"
- And I submit the comment
- Then I should see an empty comment text field
- And I should not see the comment preview
-
- @javascript
- Scenario: I can delete a comment
- Given I leave a comment like "XML attached"
- Then I should see a comment saying "XML attached"
- And I delete a comment
- Then I should not see a comment saying "XML attached"
-
- @javascript
- Scenario: I can edit a comment with +1
- Given I leave a comment like "XML attached"
- And I edit the last comment with a +1
- Then I should see +1 in the description
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
index cbe1cae096e..bf1b88c60d7 100644
--- a/features/steps/shared/note.rb
+++ b/features/steps/shared/note.rb
@@ -6,70 +6,12 @@ module SharedNote
wait_for_requests if javascript_test?
end
- step 'I delete a comment' do
- page.within('.main-notes-list') do
- note = find('.note')
- note.hover
-
- find('.more-actions').click
- find('.more-actions .dropdown-menu li', match: :first)
-
- accept_confirm { find(".js-note-delete").click }
- end
- end
-
step 'I haven\'t written any comment text' do
page.within(".js-main-target-form") do
fill_in "note[note]", with: ""
end
end
- step 'I leave a comment like "XML attached"' do
- page.within(".js-main-target-form") do
- fill_in "note[note]", with: "XML attached"
- click_button "Comment"
- end
-
- wait_for_requests
- end
-
- step 'I preview a comment text like "Bug fixed :smile:"' do
- page.within(".js-main-target-form") do
- fill_in "note[note]", with: "Bug fixed :smile:"
- find('.js-md-preview-button').click
- end
- end
-
- step 'I submit the comment' do
- page.within(".js-main-target-form") do
- click_button "Comment"
- end
-
- wait_for_requests
- end
-
- step 'I write a comment like ":+1: Nice"' do
- page.within(".js-main-target-form") do
- fill_in 'note[note]', with: ':+1: Nice'
- end
- end
-
- step 'I should not see a comment saying "XML attached"' do
- expect(page).not_to have_css(".note")
- end
-
- step 'I should not see the cancel comment button' do
- page.within(".js-main-target-form") do
- should_not have_link("Cancel")
- end
- end
-
- step 'I should not see the comment preview' do
- page.within(".js-main-target-form") do
- expect(find('.js-md-preview')).not_to be_visible
- end
- end
-
step 'The comment preview tab should say there is nothing to do' do
page.within(".js-main-target-form") do
find('.js-md-preview-button').click
@@ -77,71 +19,7 @@ module SharedNote
end
end
- step 'I should not see the comment text field' do
- page.within(".js-main-target-form") do
- expect(find('.js-note-text')).not_to be_visible
- end
- end
-
- step 'I should see a comment saying "XML attached"' do
- page.within(".note") do
- expect(page).to have_content("XML attached")
- end
- end
-
- step 'I should see an empty comment text field' do
- page.within(".js-main-target-form") do
- expect(page).to have_field("note[note]", with: "")
- end
- end
-
- step 'I should see the comment write tab' do
- page.within(".js-main-target-form") do
- expect(page).to have_css('.js-md-write-button', visible: true)
- end
- end
-
- step 'The comment preview tab should be display rendered Markdown' do
- page.within(".js-main-target-form") do
- find('.js-md-preview-button').click
- expect(find('.js-md-preview')).to have_css('gl-emoji', visible: true)
- end
- end
-
- step 'I should see the comment preview' do
- page.within(".js-main-target-form") do
- expect(page).to have_css('.js-md-preview', visible: true)
- end
- end
-
step 'I should see no notes at all' do
expect(page).not_to have_css('.note')
end
-
- # Markdown
-
- step 'I edit the last comment with a +1' do
- page.within(".main-notes-list") do
- note = find('.note')
- note.hover
-
- note.find('.js-note-edit').click
- end
-
- page.find('.current-note-edit-form textarea')
-
- page.within(".current-note-edit-form") do
- fill_in 'note[note]', with: '+1 Awesome!'
- click_button 'Save comment'
- end
- wait_for_requests
- end
-
- step 'I should see +1 in the description' do
- page.within(".note") do
- expect(page).to have_content("+1 Awesome!")
- end
-
- wait_for_requests
- end
end