Commit 2bf3846a authored by Bob Van Landuyt's avatar Bob Van Landuyt

Add matcher for emoji

parent c39e3f22
......@@ -45,7 +45,7 @@ feature 'Admin Broadcast Messages' do
page.within('.broadcast-message-preview') do
expect(page).to have_selector('strong', text: 'Markdown')
expect(page).to have_selector('gl-emoji[data-name="tada"]')
expect(page).to have_emoji('tada')
end
end
end
......@@ -98,7 +98,7 @@ feature 'Group show page' do
it 'shows the project info' do
expect(page).to have_content(project.title)
expect(page).to have_selector('gl-emoji[data-name="smile"]')
expect(page).to have_emoji('smile')
end
end
end
......@@ -99,7 +99,7 @@ describe 'User interacts with awards in an issue', :js do
click_button('Comment')
end
expect(page).to have_selector('gl-emoji[data-name="smile"]')
expect(page).to have_emoji('smile')
end
context 'when a project is archived' do
......@@ -118,7 +118,7 @@ describe 'User interacts with awards in an issue', :js do
it 'shows the award on the note' do
page.within('.note-awards') do
expect(page).to have_selector('gl-emoji[data-name="100"]')
expect(page).to have_emoji('100')
end
end
......@@ -141,7 +141,7 @@ describe 'User interacts with awards in an issue', :js do
wait_for_requests
page.within('.note-awards') do
expect(page).to have_selector('gl-emoji[data-name="8ball"]')
expect(page).to have_emoji('8ball')
end
expect(note.reload.award_emoji.size).to eq(2)
end
......
RSpec::Matchers.define :have_emoji do |emoji_name|
match do |actual|
expect(actual).to have_selector("gl-emoji[data-name='#{emoji_name}']")
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment