We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is how I configure the tenant for request specs on rails_helper.rb:
rails_helper.rb
config.before(:each, type: :request) do |spec| unless spec.metadata[:without_agency] agency = create(:agency, name: 'Default Agency') ActsAsTenant.test_tenant = agency host! "#{agency.subdomain}.example.com" end end config.after(:each, type: :request) do ActsAsTenant.test_tenant = nil end
This is my test:
let!(:agency) { create(:agency) } let!(:user) { create(:user, agency: agency) } let!(:access_token) { create(:access_token, user: user) } let(:headers) do { 'Authorization' => "Bearer #{access_token.unhashed_access_token}" } end context 'when agency from subdomain exists' do it do host! "#{agency.subdomain}.example.com" get '/dummies', headers: headers expect(Current.agency).to be agency end end
In the controller, the current_tenant is the agency created on test, but the user agency is the created on rails_helper.rb:
current_tenant
I'm probably missing out something. What I doing wrong?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is how I configure the tenant for request specs on
rails_helper.rb
:This is my test:
In the controller, the
current_tenant
is the agency created on test, but the user agency is the created onrails_helper.rb
:I'm probably missing out something. What I doing wrong?
The text was updated successfully, but these errors were encountered: