Migration to Ruby 2.5, Rails 5.1.5, Elasticsearch 5.4.3

This commit is contained in:
Joerg Reichert 2018-03-18 21:21:59 +01:00
parent 85d2ad5d57
commit ad77627973
17 changed files with 180 additions and 170 deletions

View file

@ -9,13 +9,13 @@ RSpec.describe Paper do
it { should validate_length_of(:url).is_at_most(1000) }
context "URL uniqueness" do
subject { FactoryGirl.build(:paper) }
subject { FactoryBot.build(:paper) }
it { should validate_uniqueness_of(:url) }
end
it "validate url format sane" do
expected_error = "ist keine gültige URL"
paper = FactoryGirl.build(:paper, url: "wtf")
paper = FactoryBot.build(:paper, url: "wtf")
expect(paper).not_to be_valid, "Expected paper to not be valid with invalid URL"
expect(paper.errors[:url]).not_to be_empty
expect(paper.errors[:url]).to include(expected_error), "Expected #{paper.errors[:url]} to include \"#{expected_error}\""
@ -40,7 +40,7 @@ RSpec.describe Paper do
it { should validate_presence_of(:published_at) }
it "validate date is parseable" do
expected_error = "ist kein gültiges Datum"
paper = FactoryGirl.build(:paper, published_at: "fubar")
paper = FactoryBot.build(:paper, published_at: "fubar")
expect(paper).not_to be_valid
expect(paper.errors[:published_at]).not_to be_empty
expect(paper.errors[:published_at]).to include(expected_error), "Expected #{paper.errors[:published_at]} to include \"#{expected_error}\""