diff --git a/spec/models/watchlist_entry_spec.rb b/spec/models/watchlist_entry_spec.rb index 4e938f777..f76eacda4 100644 --- a/spec/models/watchlist_entry_spec.rb +++ b/spec/models/watchlist_entry_spec.rb @@ -7,14 +7,16 @@ it "must have a medium" do entry = FactoryBot.build(:watchlist_entry, :with_watchlist) - entry.valid? - expect(entry.errors[:medium]).to include("muss ausgefüllt werden") + expect(entry).not_to be_valid + expect(entry.errors).to have_key(:medium) + expect(entry.errors).not_to have_key(:watchlist) end it "must have a watchlist" do entry = FactoryBot.build(:watchlist_entry, :with_medium) - entry.valid? - expect(entry.errors[:watchlist]).to include("muss ausgefüllt werden") + expect(entry).not_to be_valid + expect(entry.errors).to have_key(:watchlist) + expect(entry.errors).not_to have_key(:medium) end it "can only be once inside a watchlist" do diff --git a/spec/models/watchlist_spec.rb b/spec/models/watchlist_spec.rb index 5c511bf37..1432eccc2 100644 --- a/spec/models/watchlist_spec.rb +++ b/spec/models/watchlist_spec.rb @@ -7,8 +7,8 @@ it "must have a name" do watchlist = Watchlist.new(name: nil) - watchlist.valid? - expect(watchlist.errors[:name]).to include("muss ausgefüllt werden") + expect(watchlist).not_to be_valid + expect(watchlist.errors).to have_key(:name) end it "must have a unique name" do