Sha256: e9945090066fa238de2beafa0418e8b0fe7efc50544af728f8b27177b73dd8b2
Contents?: true
Size: 862 Bytes
Versions: 13
Compression:
Stored size: 862 Bytes
Contents
require 'spec_helper' describe MessagesController do let(:user) { create(:user) } let(:exercise) { create(:exercise) } before { set_current_user! user } before { allow_any_instance_of(MessagesController).to receive(:message_params).and_return content: 'foo' } describe 'post when no previous assignment' do before { post :create, params: {exercise_id: exercise.id} } it { expect(response.status).to eq 302 } it { expect(user.assignments.size).to eq 1 } it { expect(user.messages.size).to eq 1 } end describe 'post when previous assignment' do let(:assignment) { exercise.submit_solution!(user, content: '') } before { post :create, params: {exercise_id: exercise.id} } it { expect(response.status).to eq 302 } it { expect(user.assignments.size).to eq 1 } it { expect(user.messages.size).to eq 1 } end end
Version data entries
13 entries across 13 versions & 1 rubygems