-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly manual adjustment rather than autocorrect function due to inconsistency in autocorrect
- Loading branch information
1 parent
b4e9ab2
commit dab8918
Showing
6 changed files
with
626 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,10 @@ | |
expect(mail.body).to include('[email protected]') | ||
expect(mail.body).to include('New Body') | ||
expect(mail.body).to include("Please") | ||
expect(mail.body).to include("http://test.host/admin/bodies/new?change_request_id=#{change_request_id}") | ||
expect(mail.body).to include("http://test.host/admin/change_requests/#{change_request_id}/edit") | ||
expect(mail.body).to include("http://test.host/admin/bodies/" \ | ||
"new?change_request_id=#{change_request_id}") | ||
expect(mail.body).to include("http://test.host/admin/change_requests/" \ | ||
"#{change_request_id}/edit") | ||
end | ||
|
||
it 'sets render_recaptcha to true if there is no logged in user' do | ||
|
@@ -83,7 +85,8 @@ | |
post :create, params: { | ||
public_body_change_request: @change_request_params | ||
} | ||
expected_text = "Your request to add an authority has been sent. Thank you for getting in touch! We'll get back to you soon." | ||
expected_text = "Your request to add an authority has been sent. " \ | ||
"Thank you for getting in touch! We'll get back to you soon." | ||
expect(flash[:notice]).to eq(expected_text) | ||
end | ||
|
||
|
@@ -96,7 +99,9 @@ | |
end | ||
|
||
it 'has rudimentary spam protection' do | ||
spam_request_params = @change_request_params.merge({ comment: 'I AM A SPAMBOT' }) | ||
spam_request_params = @change_request_params.merge( | ||
{ comment: 'I AM A SPAMBOT' } | ||
) | ||
|
||
post :create, params: { | ||
public_body_change_request: spam_request_params | ||
|
@@ -133,22 +138,27 @@ | |
deliveries = ActionMailer::Base.deliveries | ||
expect(deliveries.size).to eq(1) | ||
mail = deliveries[0] | ||
expect(mail.subject).to match(/Update email address - #{@public_body.name}/) | ||
expect(mail.subject). | ||
to match(/Update email address - #{@public_body.name}/) | ||
expect(mail.header['Reply-To'].to_s).to include(@email) | ||
expect(mail.to).to include('postmaster@localhost') | ||
expect(mail.body).to include('[email protected]') | ||
expect(mail.body).to include(@public_body.name) | ||
expect(mail.body).to include("Please") | ||
expect(mail.body).to include("http://test.host/admin/bodies/#{@public_body.id}/edit?change_request_id=#{change_request_id}") | ||
expect(mail.body).to include("http://test.host/admin/change_requests/#{change_request_id}/edit") | ||
expect(mail.body).to include("http://test.host/admin/bodies/" \ | ||
"#{@public_body.id}/edit?change_request_id=#{change_request_id}") | ||
expect(mail.body).to include("http://test.host/admin/change_requests/" \ | ||
"#{change_request_id}/edit") | ||
end | ||
|
||
it 'should show a notice' do | ||
allow(@controller).to receive(:verify_recaptcha).and_return(true) | ||
post :create, params: { | ||
public_body_change_request: @change_request_params | ||
} | ||
expected_text = "Your request to update the address for #{@public_body.name} has been sent. Thank you for getting in touch! We'll get back to you soon." | ||
expected_text = "Your request to update the address for " \ | ||
"#{@public_body.name} has been sent. Thank you for getting in " \ | ||
"touch! We'll get back to you soon." | ||
expect(flash[:notice]).to eq(expected_text) | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.