From fea9476a591559bd8fdcf17b64e5114c592a5b08 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 11 Nov 2024 16:55:14 +0100 Subject: C'est l'heure d'assurer le suivi de quelques flacons! --- test/application_system_test_case.rb | 5 +++++ test/channels/application_cable/connection_test.rb | 13 +++++++++++++ test/controllers/.keep | 0 test/controllers/wines_controller_test.rb | 8 ++++++++ test/fixtures/files/.keep | 0 test/fixtures/wines.yml | 19 +++++++++++++++++++ test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/models/wine_test.rb | 7 +++++++ test/system/.keep | 0 test/test_helper.rb | 15 +++++++++++++++ 13 files changed, 67 insertions(+) create mode 100644 test/application_system_test_case.rb create mode 100644 test/channels/application_cable/connection_test.rb create mode 100644 test/controllers/.keep create mode 100644 test/controllers/wines_controller_test.rb create mode 100644 test/fixtures/files/.keep create mode 100644 test/fixtures/wines.yml create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/models/wine_test.rb create mode 100644 test/system/.keep create mode 100644 test/test_helper.rb (limited to 'test') diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..cee29fd --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] +end diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb new file mode 100644 index 0000000..6340bf9 --- /dev/null +++ b/test/channels/application_cable/connection_test.rb @@ -0,0 +1,13 @@ +require "test_helper" + +module ApplicationCable + class ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end + end +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/controllers/wines_controller_test.rb b/test/controllers/wines_controller_test.rb new file mode 100644 index 0000000..09451be --- /dev/null +++ b/test/controllers/wines_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class WinesControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get wines_index_url + assert_response :success + end +end diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/wines.yml b/test/fixtures/wines.yml new file mode 100644 index 0000000..93bad81 --- /dev/null +++ b/test/fixtures/wines.yml @@ -0,0 +1,19 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + year: 1 + variety: MyString + region: MyString + price: 9.99 + stock: 1 + notes: MyText + +two: + name: MyString + year: 1 + variety: MyString + region: MyString + price: 9.99 + stock: 1 + notes: MyText diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/wine_test.rb b/test/models/wine_test.rb new file mode 100644 index 0000000..fd6b688 --- /dev/null +++ b/test/models/wine_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class WineTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..0c22470 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # 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 +end -- cgit v1.2.3