Nested calls seem to be fun..
This commit is contained in:
Ralf Teusner
2017-11-15 15:37:42 +01:00
parent 960025cbf8
commit fc873cb053
7 changed files with 18 additions and 18 deletions

View File

@ -69,7 +69,7 @@ describe ExecutionEnvironment do
describe '#valid_test_setup?' do
context 'with a test command and a testing framework' do
before(:each) { execution_environment.update(test_command: FactoryBot.attributes_for(:ruby)[:test_command], testing_framework: FactoryGirl.attributes_for(:ruby)[:testing_framework]) }
before(:each) { execution_environment.update(test_command: FactoryBot.attributes_for(:ruby)[:test_command], testing_framework: FactoryBot.attributes_for(:ruby)[:testing_framework]) }
it 'is valid' do
expect(execution_environment.errors[:test_command]).to be_blank

View File

@ -1,7 +1,7 @@
require 'rails_helper'
describe Submission do
let(:submission) { FactoryBot.create(:submission, exercise: FactoryGirl.create(:dummy)) }
let(:submission) { FactoryBot.create(:submission, exercise: FactoryBot.create(:dummy)) }
it 'validates the presence of a cause' do
expect(described_class.create.errors[:cause]).to be_present
@ -69,7 +69,7 @@ describe Submission do
before(:each) do
10.times.each_with_index do |_, index|
FactoryBot.create(:submission, exercise: submission.exercise, user: (index.even? ? user : FactoryGirl.create(:external_user)))
FactoryBot.create(:submission, exercise: submission.exercise, user: (index.even? ? user : FactoryBot.create(:external_user)))
end
end
@ -99,7 +99,7 @@ describe Submission do
it 'does not redirect other users' do
9.times do |i|
submission = FactoryBot.build(:submission, exercise: exercise, user: FactoryGirl.build(:external_user, id: (11 - exercise.created_at.to_i % 10) - i - 1))
submission = FactoryBot.build(:submission, exercise: exercise, user: FactoryBot.build(:external_user, id: (11 - exercise.created_at.to_i % 10) - i - 1))
expect(submission.send(:redirect_to_feedback?)).to be_falsey
end
end
@ -116,7 +116,7 @@ describe Submission do
it 'does not redirect other users' do
9.times do |i|
submission = FactoryBot.build(:submission, exercise: exercise, user: FactoryGirl.build(:external_user, id: (11 - exercise.created_at.to_i % 10) - i - 1))
submission = FactoryBot.build(:submission, exercise: exercise, user: FactoryBot.build(:external_user, id: (11 - exercise.created_at.to_i % 10) - i - 1))
expect(submission.send(:redirect_to_feedback?)).to be_falsey
end
end
@ -128,7 +128,7 @@ describe Submission do
it 'sends nobody to feedback page' do
30.times do |i|
submission = FactoryBot.create(:submission, exercise: exercise, user: FactoryGirl.create(:external_user))
submission = FactoryBot.create(:submission, exercise: exercise, user: FactoryBot.create(:external_user))
expect(submission.send(:redirect_to_feedback?)).to be_falsey
end
end