-
-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix now
qualifier on set_flash
when is called after the key and expected message is set
#752
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,48 @@ def store_within(controller) | |
expect(controller).not_to set_flash.now['key for flash'] | ||
end | ||
end | ||
|
||
context 'when the now qualifier is called after the key is set' do | ||
it 'does not match when controller set flash' do | ||
controller = build_fake_response do | ||
flash['key for flash'] = 'value for flash' | ||
end | ||
|
||
expect(controller).not_to set_flash['key for flash'].now | ||
end | ||
|
||
it 'match when controller set flash.now' do | ||
controller = build_fake_response do | ||
flash.now['key for flash.now'] = 'value for flash.now' | ||
end | ||
|
||
expect(controller).to set_flash['key for flash.now'].now | ||
end | ||
end | ||
|
||
context 'when the now qualifier is called after the to is called' do | ||
it 'does not match when controller set flash' do | ||
controller = build_fake_response do | ||
flash['to for flash'] = 'value for flash' | ||
end | ||
|
||
expect(controller).not_to set_flash['to for flash'].to('value for flash').now | ||
end | ||
|
||
it 'match when controller set flash.now' do | ||
controller = build_fake_response do | ||
flash.now['to for flash.now'] = 'value for flash.now' | ||
end | ||
|
||
expect(controller).to set_flash['to for flash.now'].to('value for flash.now').now | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [87/80] |
||
end | ||
|
||
it 'does not match when controller set flash.now with a different message' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [81/80] |
||
controller = build_fake_response do | ||
flash.now['to for flash.now'] = 'value for flash.now' | ||
end | ||
|
||
expect(controller).not_to set_flash['to for flash.now'].to('other message').now | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [85/80] |
||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [83/80]