diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-11-19 13:20:09 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-11-19 13:20:09 +0200 |
commit | 23c5473cc0bd9b9034c5671fbea1356b0fb531e5 (patch) | |
tree | 1e3360ab65b6a9d771de97d7d1fccfeba2e16d10 /features | |
parent | 2c7d8678623a9e207d54e2e39d7eef9e2f77cb47 (diff) | |
download | gitlab-ce-23c5473cc0bd9b9034c5671fbea1356b0fb531e5.tar.gz |
added spinach tests
Diffstat (limited to 'features')
-rw-r--r-- | features/project/issues/award_emoji.feature | 14 | ||||
-rw-r--r-- | features/steps/project/issues/award_emoji.rb | 41 |
2 files changed, 55 insertions, 0 deletions
diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature new file mode 100644 index 00000000000..a9bc8ffb9bb --- /dev/null +++ b/features/project/issues/award_emoji.feature @@ -0,0 +1,14 @@ +Feature: Award Emoji + Background: + Given I sign in as a user + And I own project "Shop" + And project "Shop" has issue "Bugfix" + And I visit "Bugfix" issue page + + @javascript + Scenario: I add and remove award in the issue + Given I click to emoji-picker + 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 diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb new file mode 100644 index 00000000000..8f7a45dec0e --- /dev/null +++ b/features/steps/project/issues/award_emoji.rb @@ -0,0 +1,41 @@ +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 + 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 + 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" + 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" + end + end + + step 'project "Shop" has issue "Bugfix"' do + @project = Project.find_by(name: "Shop") + @issue = create(:issue, title: "Bugfix", project: project) + end +end |