-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic system test for all three services
- Loading branch information
1 parent
1ef2621
commit dae006e
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |