Created
March 28, 2019 11:43
-
-
Save MaryKuz/5e67580591a53cd248dd9bbdc8082a19 to your computer and use it in GitHub Desktop.
Cover the decorator with tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe UserDecorator do | |
describe '#as_json' do | |
let(:user) { stub_model User, name: 'Test name', email: 'test@test.com' } | |
subject { user.decorate.as_json } | |
its([:name]) { should eq 'Test name' } | |
its([:email]) { should eq 'test@test.com' } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment