-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update home specs to be more accurate
and tenancy-aware
- Loading branch information
Showing
1 changed file
with
9 additions
and
7 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 |
---|---|---|
@@ -1,27 +1,29 @@ | ||
RSpec.describe 'Home page', type: :request do | ||
context 'with multitenancy' do | ||
describe 'GET /' do | ||
context "on the primary host" do | ||
context 'on the primary host' do | ||
before { host! 'localhost' } | ||
it 'redirects to the accounts landing page' do | ||
get root_path | ||
expect(response).to have_http_status(200) | ||
end | ||
end | ||
|
||
context "on a subhost" do | ||
before { host! 'foo.bar.com' } | ||
context 'on an unknown subhost' do | ||
before { host! 'mystery.localhost' } | ||
it 'raises a 404' do | ||
expect { get root_path }.to raise_error(ActionController::RoutingError) | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'GET /' do | ||
it 'works! (now write some real specs)' do | ||
get root_path | ||
expect(response).to have_http_status(200) | ||
context 'with singletenancy', singletenant: true do | ||
describe 'GET /' do | ||
it 'fields the request' do | ||
get root_path | ||
expect(response).to have_http_status(200) | ||
end | ||
end | ||
end | ||
end |