From 377d7d1ba87c02b98bfad2d99d07fa69eb358c69 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Mon, 9 Mar 2020 11:44:19 +0100 Subject: [PATCH] Remove unused test/ directory --- test/controllers/.keep | 0 test/controllers/search_controller_test.rb | 7 --- test/controllers/sessions_controller_test.rb | 7 --- test/fixtures/.keep | 0 test/fixtures/importers.yml | 11 ----- test/fixtures/users.yml | 11 ----- test/helpers/.keep | 0 test/integration/.keep | 0 test/integration/routes_test.rb | 8 --- test/mailers/.keep | 0 test/models/.keep | 0 test/models/importer_test.rb | 7 --- test/models/paper_test.rb | 52 -------------------- test/models/user_test.rb | 7 --- test/test_helper.rb | 19 ------- 15 files changed, 129 deletions(-) delete mode 100644 test/controllers/.keep delete mode 100644 test/controllers/search_controller_test.rb delete mode 100644 test/controllers/sessions_controller_test.rb delete mode 100644 test/fixtures/.keep delete mode 100644 test/fixtures/importers.yml delete mode 100644 test/fixtures/users.yml delete mode 100644 test/helpers/.keep delete mode 100644 test/integration/.keep delete mode 100644 test/integration/routes_test.rb delete mode 100644 test/mailers/.keep delete mode 100644 test/models/.keep delete mode 100644 test/models/importer_test.rb delete mode 100644 test/models/paper_test.rb delete mode 100644 test/models/user_test.rb delete mode 100644 test/test_helper.rb diff --git a/test/controllers/.keep b/test/controllers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb deleted file mode 100644 index bfbf22d..0000000 --- a/test/controllers/search_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SearchControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb deleted file mode 100644 index d30ebc3..0000000 --- a/test/controllers/sessions_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SessionsControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/fixtures/.keep b/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/fixtures/importers.yml b/test/fixtures/importers.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/importers.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/users.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/helpers/.keep b/test/helpers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/integration/.keep b/test/integration/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/integration/routes_test.rb b/test/integration/routes_test.rb deleted file mode 100644 index 29f95fa..0000000 --- a/test/integration/routes_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class RoutesTest < ActionDispatch::IntegrationTest - test "route test" do - assert_generates "/import", { :controller => "import", :action => "new_papers_callback" } - assert_generates "/", :controller => "search", :action => "index" - end -end \ No newline at end of file diff --git a/test/mailers/.keep b/test/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/models/.keep b/test/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/models/importer_test.rb b/test/models/importer_test.rb deleted file mode 100644 index 7d2f9e5..0000000 --- a/test/models/importer_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class ImporterTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/paper_test.rb b/test/models/paper_test.rb deleted file mode 100644 index a8535da..0000000 --- a/test/models/paper_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'test_helper' - -class PaperTest < ActiveSupport::TestCase - - context "Validations" do - should validate_presence_of(:name) - should validate_length_of(:name).is_at_most(1000) - - should validate_presence_of(:url) - should validate_length_of(:url).is_at_most(1000) - context "URL uniqueness" do - subject { FactoryBot.build(:paper) } - should validate_uniqueness_of(:url) - end - should "validate url format sane" do - expected_error = "ist keine gültige URL" - 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}\"" - end - - should validate_presence_of(:reference) - should validate_length_of(:reference).is_at_most(100) - - should validate_presence_of(:body) - should validate_length_of(:body).is_at_most(100) - - should validate_presence_of(:content) - should validate_length_of(:content).is_at_most(100_000) - - should validate_presence_of(:originator) - should validate_length_of(:originator).is_at_most(300) - - should validate_presence_of(:paper_type) - should validate_length_of(:paper_type).is_at_most(50) - - context "published_at" do - should validate_presence_of(:published_at) - should "validate date is parseable" do - expected_error = "ist kein gültiges Datum" - 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}\"" - end - end - - should validate_length_of(:resolution).is_at_most(30_000) - end - -end diff --git a/test/models/user_test.rb b/test/models/user_test.rb deleted file mode 100644 index 82f61e0..0000000 --- a/test/models/user_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index f92d6dc..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'simplecov' -SimpleCov.start 'rails' - -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' -require 'capybara/rails' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. - # fixtures :all - - # Add more helper methods to be used by all tests here... -end - -class ActionDispatch::IntegrationTest - # Make the Capybara DSL available in all integration tests - include Capybara::DSL -end