diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7c0a5fdff..a8c68aa1d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: run: bin/rails db:schema:load # Add or replace test runners here - name: Run Ruby tests - run: bundle exec rspec + run: bundle exec rspec --profile - name: Run JS tests run: npm test # Add or replace any other lints here diff --git a/config/vite.json b/config/vite.json index 7a12cb9134..d8e3441ae6 100644 --- a/config/vite.json +++ b/config/vite.json @@ -19,6 +19,7 @@ "autoBuild": true }, "test": { + "host": "::1", "port": 3037, "autoBuild": true } diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 2db6251600..108acc00ae 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -2,7 +2,7 @@ require "i18n/tasks" -RSpec.describe I18n do +RSpec.describe I18n, :slow do let(:i18n) { I18n::Tasks::BaseTask.new } let(:missing_keys) { i18n.missing_keys } let(:unused_keys) { i18n.unused_keys } diff --git a/spec/requests/authentication_controller_spec.rb b/spec/requests/authentication_controller_spec.rb index 5c47afde76..826d046b23 100644 --- a/spec/requests/authentication_controller_spec.rb +++ b/spec/requests/authentication_controller_spec.rb @@ -83,7 +83,7 @@ def authenticate! GDS::SSO::Config.auth_valid_for = Settings.auth_valid_for end - it "re-authenticates after the configured time" do + it "re-authenticates after the configured time", :slow do login_as_standard_user get root_path diff --git a/spec/support/mark_feature_specs_as_slow.rb b/spec/support/mark_feature_specs_as_slow.rb new file mode 100644 index 0000000000..67d45e57ea --- /dev/null +++ b/spec/support/mark_feature_specs_as_slow.rb @@ -0,0 +1,5 @@ +RSpec.configure do |config| + config.define_derived_metadata(type: :feature) do |metadata| + metadata[:slow] ||= true + end +end diff --git a/spec/views/pages/selection/options.html.erb_spec.rb b/spec/views/pages/selection/options.html.erb_spec.rb index 0154a0811f..7fdccd8368 100644 --- a/spec/views/pages/selection/options.html.erb_spec.rb +++ b/spec/views/pages/selection/options.html.erb_spec.rb @@ -64,7 +64,7 @@ let(:selection_options) { (1..2999).to_a.map { |i| OpenStruct.new(name: i.to_s) } } it "has an add another button" do - expect(rendered).to have_button(I18n.t("selection_options.add_another")) + expect(rendered).to have_button(text: I18n.t("selection_options.add_another")) end it "does not have inset text stating you cannot add more options" do @@ -76,7 +76,7 @@ let(:selection_options) { (1..3000).to_a.map { |i| OpenStruct.new(name: i.to_s) } } it "does not have an add another button" do - expect(rendered).not_to have_button(I18n.t("selection_options.add_another")) + expect(rendered).not_to have_button(text: I18n.t("selection_options.add_another")) end it "has inset text stating you cannot add more options" do