spec/lib/card/success_spec.rb in card-1.17.4 vs spec/lib/card/success_spec.rb in card-1.18.0
- old
+ new
@@ -20,44 +20,44 @@
context 'initialized with hash' do
before do
success_params id: home.id, view: 'closed'
end
- it { is_expected.to eq home}
+ it { is_expected.to eq home }
end
context 'initialized with REDIRECT string' do
before do
success_params 'REDIRECT: Home'
end
- it { is_expected.to eq home}
+ it { is_expected.to eq home }
end
context 'initialized with TEXT string' do
before do
success_params 'TEXT: Hi'
end
- it { is_expected.to eq 'Hi'}
+ it { is_expected.to eq 'Hi' }
end
context 'initialized with card object' do
before do
success_params home
end
- it { is_expected.to eq home}
+ it { is_expected.to eq home }
end
context 'initialized with url' do
before do
success_params 'http://wagn.org'
end
- it { is_expected.to eq 'http://wagn.org'}
+ it { is_expected.to eq 'http://wagn.org' }
end
end
describe '#to_url' do
- subject { @success.to_url}
+ subject { @success.to_url }
context 'with params' do
context 'using initilization' do
before do
success_params id: home.id, view: 'closed', layout: 'my_layout'
end
@@ -78,20 +78,20 @@
it { is_expected.to eq '/A?view=closed' }
end
context 'using <<' do
before do
success_params nil
- @success << { card: home, view: 'closed'}
+ @success << { card: home, view: 'closed' }
end
it { is_expected.to eq '/Home?view=closed' }
end
end
context 'redirect string' do
before do
success_params 'REDIRECT: *previous'
end
- it { is_expected.to eq previous}
+ it { is_expected.to eq previous }
end
end
describe '#soft_redirect?' do
it 'returns true if soft_redirect parameter is true' do
@@ -100,11 +100,11 @@
end
end
describe '#hard_redirect?' do
it 'true for "REDIRECT: anywhere"' do
- success_params "REDIRECT: anywhere"
+ success_params 'REDIRECT: anywhere'
expect(@success.hard_redirect?).to be_truthy
end
end
describe '#mark=' do
@@ -133,18 +133,16 @@
@success.apply script: 'Script'
@success << { structure: 'Structure' }
expect(@success.params.keys.sort).to eq [:layout, :script, :structure, :view]
end
it 'ignores "id", "name", "mark", "card"", target", and "redirect"' do
- success_params({
- id: 5,
- name: 'Home',
- card: Card['Home'],
- mark: 'Home',
- target: 'Home',
- redirect: false,
- view: 'View'
- })
+ success_params(id: 5,
+ name: 'Home',
+ card: Card['Home'],
+ mark: 'Home',
+ target: 'Home',
+ redirect: false,
+ view: 'View')
expect(@success.params.keys).to eq [:view]
end
end
end