Upgraded to Rails 4

This commit is contained in:
2019-02-24 15:47:27 +01:00
parent f52ec0411d
commit f809f36c06
86 changed files with 732 additions and 662 deletions

View File

@@ -2,11 +2,11 @@ require 'spec_helper'
describe Calentry do
let(:rubrik) {FactoryGirl.create(:rubrik)}
let(:user) {FactoryGirl.create(:user)}
let(:calendar) {FactoryGirl.create(:calendar,updated_at: 1.hour.ago)}
let(:neuigkeit) {FactoryGirl.create(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id, updated_at: 1.hour.ago)}
subject(:calentry) {FactoryGirl.build(:calentry, calendar_id: calendar.id, object_type: "Neuigkeit",object_id: neuigkeit.id)}
let(:rubrik) {FactoryBot.create(:rubrik)}
let(:user) {FactoryBot.create(:user)}
let(:calendar) {FactoryBot.create(:calendar,updated_at: 1.hour.ago)}
let(:neuigkeit) {FactoryBot.create(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id, updated_at: 1.hour.ago)}
subject(:calentry) {FactoryBot.build(:calentry, calendar_id: calendar.id, object_type: "Neuigkeit",object_id: neuigkeit.id)}
it "is valid with full data" do
expect(calentry).to be_valid
@@ -14,7 +14,7 @@ describe Calentry do
[:ende,:start,:typ].each do |attr|
it "is not valid without #{attr}" do
e= FactoryGirl.build(:calentry, calendar_id: calendar.id, object_type: "Neuigkeit",object_id: neuigkeit.id, attr => nil)
e= FactoryBot.build(:calentry, calendar_id: calendar.id, object_type: "Neuigkeit",object_id: neuigkeit.id, attr => nil)
expect(e).not_to be_valid
expect(e).to have_at_least(1).errors_on(attr)
end