Test basic email flow

parent 13b423ce
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%p.light %p.light
You can notify the app / group or a project by sending them an email notification You can notify the app / group or a project by sending them an email notification
= form_tag admin_email_path, class: 'form-horizontal' do = form_tag admin_email_path, class: 'form-horizontal', id: 'new-admin-email' do
.form-group .form-group
%label.control-label{for: :subject} Subject %label.control-label{for: :subject} Subject
.col-sm-10 .col-sm-10
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
Feature: Admin email Feature: Admin email
Background: Background:
Given I sign in as an admin Given I sign in as an admin
And I visit admin email page And there are groups with projects
Scenario: Create a new email notification Scenario: Create a new email notification
When I click new email notification Given I visit admin email page
And submit form with email notification info When I submit form with email notification info
Then I should see a notification email is begin send Then I should see a notification email is begin send
class Spinach::Features::AdminEmail < Spinach::FeatureSteps class Spinach::Features::AdminEmail < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedAdmin
step 'I see all previous email notifications' do step 'I submit form with email notification info' do
pending 'step not implemented' @email_text = "I've moved the project"
@selected_project = Group.last.projects.first
within('form#new-admin-email') do
fill_in :subject, with: 'my subject'
fill_in :body, with: @email_text
select "#{@selected_project.group.name} / #{@selected_project.name}", from: :recipients
find('.btn-create').click
end end
step 'I click new email notification' do
pending 'step not implemented'
end
step 'submit form with email notification info' do
pending 'step not implemented'
end
step 'I should be redirected to the email notification page' do
pending 'step not implemented'
end
step 'I should see newly created email notification' do
pending 'step not implemented'
end
step 'email notification \'maintenance\'' do
pending 'step not implemented'
end
step 'I visit email notification \'maintenance\'' do
pending 'step not implemented'
end
step 'I submit recipients' do
pending 'step not implemented'
end
step 'I should see the reciepints' do
pending 'step not implemented'
end
step 'email notification \'maintenance\' with selected recipients' do
pending 'step not implemented'
end
step 'I click send' do
pending 'step not implemented'
end end
step 'I should see the notification has been sent' do step 'I should see a notification email is begin send' do
pending 'step not implemented' expect(find('.flash-notice')).to have_content 'Email send'
end end
end end
\ No newline at end of file
...@@ -8,5 +8,12 @@ module SharedAdmin ...@@ -8,5 +8,12 @@ module SharedAdmin
And 'system has users' do And 'system has users' do
2.times { create(:user) } 2.times { create(:user) }
end end
And 'there are groups with projects' do
2.times do
group = create :group
create :project, group: group
end
end
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