debian-mirror-gitlab/features/steps/project/issues/award_emoji.rb

49 lines
1.2 KiB
Ruby
Raw Normal View History

2015-11-26 14:37:03 +05:30
class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
include Select2Helper
step 'I visit "Bugfix" issue page' do
visit namespace_project_issue_path(@project.namespace, @project, @issue)
end
step 'I click to emoji-picker' do
2015-12-23 02:04:40 +05:30
page.within '.awards-controls' do
page.find('.add-award').click
2015-11-26 14:37:03 +05:30
end
end
step 'I click to emoji in the picker' do
2015-12-23 02:04:40 +05:30
page.within '.awards-menu' do
page.first('img').click
2015-11-26 14:37:03 +05:30
end
end
step 'I can remove it by clicking to icon' do
2015-12-23 02:04:40 +05:30
page.within '.awards' do
page.first('.award').click
expect(page).to_not have_selector '.award'
2015-11-26 14:37:03 +05:30
end
end
step 'I have award added' do
2015-12-23 02:04:40 +05:30
page.within '.awards' do
expect(page).to have_selector '.award'
expect(page.find('.award .counter')).to have_content '1'
2015-11-26 14:37:03 +05:30
end
end
step 'project "Shop" has issue "Bugfix"' do
2015-12-23 02:04:40 +05:30
@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
2015-11-26 14:37:03 +05:30
end
end