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,12 +9,12 @@ class PaperTest < ActiveSupport::TestCase
should validate_presence_of(:url)
should validate_length_of(:url).is_at_most(1000)
context "URL uniqueness" do
subject { FactoryGirl.build(:paper) }
subject { FactoryBot.build(:paper) }
should validate_uniqueness_of(:url)
end
should "validate url format sane" do
expected_error = "ist keine gültige URL"
paper = FactoryGirl.build(:paper, url: "wtf")
paper = FactoryBot.build(:paper, url: "wtf")
assert_not paper.valid?, "Expected paper to not be valid with invalid URL"
assert_not paper.errors[:url].empty?
assert paper.errors[:url].include?(expected_error), "Expected #{paper.errors[:url]} to include \"#{expected_error}\""
@ -39,7 +39,7 @@ class PaperTest < ActiveSupport::TestCase
should validate_presence_of(:published_at)
should "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")
assert_not paper.valid?
assert_not paper.errors[:published_at].empty?
assert paper.errors[:published_at].include?(expected_error), "Expected #{paper.errors[:published_at]} to include \"#{expected_error}\""