Sha256: 0ece97cd0664bd6cea87fd2c1a4181eab5fabf3d6790fcc0d8d08ee8e0dfd900
Contents?: true
Size: 1015 Bytes
Versions: 26
Compression:
Stored size: 1015 Bytes
Contents
require 'spec_helper' describe User, organization_workspace: :test 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_json! user_json } it { expect(user.uid).to eq 'foo@bar.com' } it { expect(user.name).to eq 'Foo Bar' } it { expect(user.student_here?).to be true } 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_json! user_json } before { User.import_from_json! new_json } it { expect(user.name).to eq 'Foo Baz' } it { expect(user.student_here?).to be true } it { expect(user.student? 'test/example2').to be true } it { expect(user.student? 'test/example').to be false } end end
Version data entries
26 entries across 26 versions & 1 rubygems