spec/base_spec.rb in upholsterer-0.4.4 vs spec/base_spec.rb in upholsterer-0.4.5
- old
+ new
@@ -181,11 +181,11 @@
describe 'as json with expose all' do
let(:comment) { double body: 'Some comment', user: 'user' }
subject { ExposeAllPresenter.new(comment).to_json }
- it { should eq '' }
+ it { should eq '{}' }
end
describe 'expose with block' do
let(:project) { double id: 1, description: 'description', type: 'type' }
subject { CollectPresenter.new(entity) }
@@ -196,19 +196,19 @@
its(:id) { should eq 1 }
its(:name) { should eq 'Test' }
its(:email) { should eq 'foo@bar.com' }
its(:type) { should eq 'test_type' }
its(:description) { should eq 'test_description' }
- its(:to_json) { should eq(name: 'Test', email: 'foo@bar.com', id: 1, description: 'test_description', type: 'test_type') }
+ its(:to_json) { should be_json_with(name: 'Test', email: 'foo@bar.com', id: 1, description: 'test_description', type: 'test_type') }
end
context 'Real presenter' do
let(:entity) { double name: 'Real', project: project, email: 'foo@bar.com' }
its(:name) { should eq 'Real' }
its(:email) { should eq 'foo@bar.com' }
its(:type) { should eq 'real_type' }
its(:description) { should eq 'real_description' }
- its(:to_json) { should eq(name: 'Real', email: 'foo@bar.com', id: 1, description: 'real_description', type: 'real_type') }
+ its(:to_json) { should be_json_with(name: 'Real', email: 'foo@bar.com', id: 1, description: 'real_description', type: 'real_type') }
end
end
end