Test basic email flow

parent 13b423ce
......@@ -3,7 +3,7 @@
%p.light
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
%label.control-label{for: :subject} Subject
.col-sm-10
......
......@@ -2,9 +2,9 @@
Feature: Admin email
Background:
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
When I click new email notification
And submit form with email notification info
Given I visit admin email page
When I submit form with email notification info
Then I should see a notification email is begin send
class Spinach::Features::AdminEmail < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedAdmin
step 'I see all previous email notifications' do
pending 'step not implemented'
step 'I submit form with email notification info' do
@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
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
step 'I should see the notification has been sent' do
pending 'step not implemented'
step 'I should see a notification email is begin send' do
expect(find('.flash-notice')).to have_content 'Email send'
end
end
\ No newline at end of file
......@@ -8,5 +8,12 @@ module SharedAdmin
And 'system has users' do
2.times { create(:user) }
end
And 'there are groups with projects' do
2.times do
group = create :group
create :project, group: group
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