spec/granite/form/config_spec.rb in granite-form-0.5.0 vs spec/granite/form/config_spec.rb in granite-form-0.6.0
- old
+ new
@@ -2,31 +2,34 @@
describe Granite::Form::Config do
subject { Granite::Form::Config.send :new }
describe '#include_root_in_json' do
- its(:include_root_in_json) { should == false }
+ its(:include_root_in_json) { is_expected.to eq false }
+
specify do
expect { subject.include_root_in_json = true }
.to change { subject.include_root_in_json }.from(false).to(true)
end
end
describe '#i18n_scope' do
- its(:i18n_scope) { should == :granite }
+ its(:i18n_scope) { is_expected.to eq :granite }
+
specify do
expect { subject.i18n_scope = :data_model }
.to change { subject.i18n_scope }.from(:granite).to(:data_model)
end
end
describe '#logger' do
- its(:logger) { should be_a Logger }
+ its(:logger) { is_expected.to be_a Logger }
end
describe '#primary_attribute' do
- its(:primary_attribute) { should == :id }
+ its(:primary_attribute) { is_expected.to eq :id }
+
specify do
expect { subject.primary_attribute = :identified }
.to change { subject.primary_attribute }.from(:id).to(:identified)
end
end
@@ -40,9 +43,10 @@
rescue Granite::Form::NormalizerMissing
nil
end
}.from(nil).to(an_instance_of(Proc))
end
+
specify { expect { subject.normalizer(:wrong) }.to raise_error Granite::Form::NormalizerMissing }
end
describe '#typecaster' do
specify do