Sha256: d45e79f0c33de8c5a12cab13f971d8fd5b9c998f5cabce3939e53a10ec13c9d2
Contents?: true
Size: 902 Bytes
Versions: 96
Compression:
Stored size: 902 Bytes
Contents
require 'spec_helper' describe InvitationsController, type: :controller, organization_workspace: :test do let(:user) { create(:user) } before { set_current_user! user } describe 'when invitation does not exist' do before { get :join, params: {code: 'foo123' } } it { expect(response.status).to eq 404 } end describe 'when invitation exists' do let(:organization) { Organization.current } let(:course) { create(:course, slug: 'test/foo-1111', name: 'Generic Course', organization: organization) } let!(:invitation) { create(:invitation, code: 'foo123', course: course ) } before { get :join, params: {code: 'foo123', user: {first_name: 'new first_name', gender: 'female'} } } before { user.reload } it { expect(response.status).to eq 302 } it { expect(user.first_name).to eq 'new first_name' } it { expect(user.gender).to eq 'female' } end end
Version data entries
96 entries across 96 versions & 1 rubygems