mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix user already subscribed exception
Prevent excpetion at user subscription when already is subscribed to a conference and add hanling to the similar unsubscribe event. remove double validation at app/models/subscription.rb update subscription_controller_spec
This commit is contained in:
parent
8bd066afbc
commit
2bf7e4bbd3
3 changed files with 8 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ describe SubscriptionsController do
|
|||
|
||||
it 'shows success message in flash notice' do
|
||||
post :create, conference_id: conference.short_title
|
||||
expect(flash[:notice]).to match("You have been subscribed to receive email notifications for #{conference.short_title}")
|
||||
expect(flash[:notice]).to match("You have subscribed to receive email notifications for #{conference.title}")
|
||||
end
|
||||
|
||||
it 'subscribes user to conference' do
|
||||
|
|
@ -47,7 +47,7 @@ describe SubscriptionsController do
|
|||
|
||||
it 'shows success message in flash notice' do
|
||||
delete :destroy, conference_id: conference.short_title
|
||||
expect(flash[:notice]).to match("You have been unsubscribed and now you will not be receiving email notifications for #{conference.short_title}.")
|
||||
expect(flash[:notice]).to match("You have unsubscribed and you will not be receiving email notifications for #{conference.title}.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue