Browse Source

fix failing test

pull/557/head
Dushan Despotovic 3 years ago committed by Kat
parent
commit
bcca42cca6
  1. 2
      app/controllers/organisations_controller.rb
  2. 2
      spec/features/user_spec.rb
  3. 2
      spec/rails_helper.rb

2
app/controllers/organisations_controller.rb

@ -45,7 +45,7 @@ class OrganisationsController < ApplicationController
def logs def logs
if current_user.support? if current_user.support?
@pagy, @case_logs = pagy(CaseLog.all.where(owning_organisation_id: @organisation.id)) @pagy, @case_logs = pagy(CaseLog.all.where(owning_organisation_id: @organisation.id))
redirect_to "/logs" render "logs", layout: "application"
end end
end end

2
spec/features/user_spec.rb

@ -581,7 +581,7 @@ RSpec.describe "User Features" do
end end
context "when the support user is on the organisations list page" do context "when the support user is on the organisations list page" do
it "they can click on an organisation to see their logs page", js: true do it "they can click on an organisation to see their logs page" do
visit("/organisations") visit("/organisations")
click_link("Test3") click_link("Test3")
expect(page).to have_selector("a", text: "#{case_log.id}") expect(page).to have_selector("a", text: "#{case_log.id}")

2
spec/rails_helper.rb

@ -11,7 +11,7 @@ require "view_component/test_helpers"
Capybara.register_driver :headless do |app| Capybara.register_driver :headless do |app|
options = Selenium::WebDriver::Firefox::Options.new options = Selenium::WebDriver::Firefox::Options.new
# options.add_argument("--headless") options.add_argument("--headless")
Capybara::Selenium::Driver.new(app, browser: :firefox, capabilities: options) Capybara::Selenium::Driver.new(app, browser: :firefox, capabilities: options)
end end

Loading…
Cancel
Save