summaryrefslogtreecommitdiff
path: root/spec/features/issues/award_emoji_spec.rb
diff options
context:
space:
mode:
authormhasbini <mohammad.hasbini@gmail.com>2017-02-28 22:38:19 +0200
committermhasbini <mohammad.hasbini@gmail.com>2017-02-28 22:38:19 +0200
commit9f949d4e24c5939b5ea4071c3e86c514b4d82970 (patch)
tree1011567dfca77bf1d259c2ebfcf8c4f8a0d3a710 /spec/features/issues/award_emoji_spec.rb
parentc5b29ed6f36779dbb96f4cdc7b1b0bce8bb8dc5e (diff)
downloadgitlab-ce-9f949d4e24c5939b5ea4071c3e86c514b4d82970.tar.gz
add /award slash command
add /award slash command; Allow posting of just an emoji in comment
Diffstat (limited to 'spec/features/issues/award_emoji_spec.rb')
-rw-r--r--spec/features/issues/award_emoji_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb
index 73e43316dc7..3ab3d2d4229 100644
--- a/spec/features/issues/award_emoji_spec.rb
+++ b/spec/features/issues/award_emoji_spec.rb
@@ -67,6 +67,18 @@ describe 'Awards Emoji', feature: true do
expect(page).not_to have_selector(emoji_counter)
end
end
+
+ context 'execute /award slash command' do
+ it 'toggles the emoji award on noteable', js: true do
+ execute_slash_command('/award :100:')
+
+ expect(find(noteable_award_counter)).to have_text("1")
+
+ execute_slash_command('/award :100:')
+
+ expect(page).not_to have_selector(noteable_award_counter)
+ end
+ end
end
end
@@ -80,6 +92,15 @@ describe 'Awards Emoji', feature: true do
end
end
+ def execute_slash_command(cmd)
+ within('.js-main-target-form') do
+ fill_in 'note[note]', with: cmd
+ click_button 'Comment'
+ end
+
+ wait_for_ajax
+ end
+
def thumbsup_emoji
page.all(emoji_counter).first
end
@@ -92,6 +113,10 @@ describe 'Awards Emoji', feature: true do
'span.js-counter'
end
+ def noteable_award_counter
+ ".awards .active"
+ end
+
def toggle_smiley_emoji(status)
within('.note') do
find('.note-emoji-button').click