Skip to content

Commit

Permalink
Update home specs to be more accurate
Browse files Browse the repository at this point in the history
and tenancy-aware
  • Loading branch information
atz committed May 12, 2017
1 parent 400432a commit fa270ea
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions spec/requests/home_spec.rb
@@ -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

0 comments on commit fa270ea

Please sign in to comment.