Sha256: 89b426b2228f1e957ae8437225fe4fd59b5df819dd024bea8438f85569f54325
Contents?: true
Size: 904 Bytes
Versions: 3
Compression:
Stored size: 904 Bytes
Contents
require 'spec_helper' describe User do let(:user) { User.find_by(uid: 'foo@bar.com') } let(:user_json) { { uid: 'foo@bar.com', first_name: 'Foo', last_name: 'Bar', permissions: {student: 'test/example'}, id: 1 } } context 'when new user' do before { User.import_from_resource_h! user_json } it { expect(user.uid).to eq 'foo@bar.com' } it { expect(user.name).to eq 'Foo Bar' } end context 'when user exists' do let(:new_json) { { uid: 'foo@bar.com', first_name: 'Foo', last_name: 'Baz', permissions: {student: 'test/example2'}, id: 1 } } before { User.import_from_resource_h! user_json } before { User.import_from_resource_h! new_json } it { expect(user.name).to eq 'Foo Baz' } it { expect(user.student? 'test/example2').to be true } it { expect(user.student? 'test/example').to be false } end end
Version data entries
3 entries across 3 versions & 1 rubygems