summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-02 14:11:32 +0000
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-03 13:39:00 +0100
commit4676ba1f7c7b37498d26815c1fbe0e02c2ffaeb8 (patch)
tree18655bb2ad3d3e99228dfbf03de75bd143701a81 /features
parenta527f5c27ff92d2ee7e2d5e78dc20b6d1d982aa0 (diff)
downloadgitlab-ce-4676ba1f7c7b37498d26815c1fbe0e02c2ffaeb8.tar.gz
Add test for award-emoji being added as regular comment
Diffstat (limited to 'features')
-rw-r--r--features/project/issues/award_emoji.feature6
-rw-r--r--features/steps/project/issues/award_emoji.rb31
2 files changed, 24 insertions, 13 deletions
diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature
index a9bc8ffb9bb..2609f129d07 100644
--- a/features/project/issues/award_emoji.feature
+++ b/features/project/issues/award_emoji.feature
@@ -11,4 +11,8 @@ Feature: Award Emoji
And I click to emoji in the picker
Then I have award added
And I can remove it by clicking to icon
- \ No newline at end of file
+
+ @javascript
+ Scenario: I add award emoji using regular comment
+ Given I leave comment with a single emoji
+ Then I have award added
diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb
index 8f7a45dec0e..325eaf2ea6a 100644
--- a/features/steps/project/issues/award_emoji.rb
+++ b/features/steps/project/issues/award_emoji.rb
@@ -9,33 +9,40 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
end
step 'I click to emoji-picker' do
- page.within ".awards-controls" do
- page.find(".add-award").click
+ page.within '.awards-controls' do
+ page.find('.add-award').click
end
end
step 'I click to emoji in the picker' do
- page.within ".awards-menu" do
- page.first("img").click
+ page.within '.awards-menu' do
+ page.first('img').click
end
end
step 'I can remove it by clicking to icon' do
- page.within ".awards" do
- page.first(".award").click
- expect(page).to_not have_selector ".award"
+ page.within '.awards' do
+ page.first('.award').click
+ expect(page).to_not have_selector '.award'
end
end
step 'I have award added' do
- page.within ".awards" do
- expect(page).to have_selector ".award"
- expect(page.find(".award .counter")).to have_content "1"
+ page.within '.awards' do
+ expect(page).to have_selector '.award'
+ expect(page.find('.award .counter')).to have_content '1'
end
end
step 'project "Shop" has issue "Bugfix"' do
- @project = Project.find_by(name: "Shop")
- @issue = create(:issue, title: "Bugfix", project: project)
+ @project = Project.find_by(name: 'Shop')
+ @issue = create(:issue, title: 'Bugfix', project: project)
+ end
+
+ step 'I leave comment with a single emoji' do
+ page.within('.js-main-target-form') do
+ fill_in 'note[note]', with: ':smile:'
+ click_button 'Add Comment'
+ end
end
end