Skip to content

Commit

Permalink
Add basic system test for all three services
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Nov 27, 2024
1 parent 1ef2621 commit dae006e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/system/find/load_the_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Find - Root path', service: :find do
include DfESignInUserHelper

it 'shows the find page' do
visit '/'
expect(page).to have_content('Find courses by location or by training provider')
end
end
22 changes: 22 additions & 0 deletions spec/system/publish/load_the_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Publish - Courses page', service: :publish do
include DfESignInUserHelper

let(:provider) { create(:provider, provider_name: 'System Provider') }
let(:course) { create(:course, provider:, name: 'System Course') }
let(:user) { create(:user, providers: [provider]) }

before do
sign_in_system_test(user:)
course
end

it 'shows the publish courses page' do
visit '/publish/organisations'
expect(page).to have_content('Sign out')
expect(page).to have_content(course.name)
end
end
21 changes: 21 additions & 0 deletions spec/system/support/load_the_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Support', service: :publish do
include DfESignInUserHelper

let(:provider) { create(:provider, provider_name: 'System Provider') }
let(:user) { create(:user, :admin, providers: [provider]) }

before do
sign_in_system_test(user:)
end

it 'shows the support page' do
visit '/publish/organisations'
click_on('Support console')
expect(page).to have_current_path(%r{/support})
expect(page).to have_content('System Provider')
end
end

0 comments on commit dae006e

Please sign in to comment.