Commit 562857d6 authored by Marin Jankovski's avatar Marin Jankovski

Fix admine email spec.

parent 130c306a
@admin
Feature: Admin email
Background:
Given I sign in as an admin
And there are groups with projects
@javascript
Scenario: Create a new email notification
Given I visit admin email page
When I submit form with email notification info
......
......@@ -15,7 +15,16 @@ class Spinach::Features::AdminEmail < Spinach::FeatureSteps
within('form#new-admin-email') do
fill_in :subject, with: 'my subject'
fill_in :body, with: @email_text
select @selected_group.name, from: :recipients
# Note: Unable to use select2 helper because
# the helper uses select2 method "val" to select the group from the dropdown
# and the method "val" requires "initSelection" to be used in the select2 call
select2_container = first("#s2id_recipients")
select2_container.find(".select2-choice").click
find(:xpath, "//body").find("input.select2-input").set(@selected_group.name)
page.execute_script(%|$("input.select2-input:visible").keyup();|)
find(:xpath, "//body").find(".group-name", text: @selected_group.name).click
find('.btn-create').click
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