Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sojan-official committed Jul 21, 2023
1 parent fe86348 commit acf5b66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_response_bot_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: bundle exec rake db:schema:load

- name: Enable ResponseBotService in installation
run: bundle exec rails runner "Features::ResponseBotService.new.enable_in_installation"
run: RAILS_ENV=test bundle exec rails runner "Features::ResponseBotService.new.enable_in_installation"

# Run Response Bot specs
- name: Run backend tests
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

describe 'GET /api/v1/accounts/{account.id}/inboxes/{inbox.id}/response_sources' do
let(:inbox) { create(:inbox, account: account) }
let!(:response_source) { create(:response_source, account: account, inbox: inbox) }
let(:agent) { create(:user, account: account, role: :agent) }
let(:administrator) { create(:user, account: account, role: :administrator) }

before do
skip('Skipping since vector is not enabled in this environment') unless Features::ResponseBotService.new.vector_extension_enabled?
Expand All @@ -61,9 +62,6 @@
end

context 'when it is an authenticated user' do
let(:agent) { create(:user, account: account, role: :agent) }
let(:administrator) { create(:user, account: account, role: :administrator) }

it 'returns unauthorized for agents' do
get "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}/response_sources",
headers: agent.create_new_auth_token,
Expand All @@ -73,6 +71,7 @@
end

it 'returns all response_sources belonging to the inbox to administrators' do
response_source = create(:response_source, account: account, inbox: inbox)
get "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}/response_sources",
headers: administrator.create_new_auth_token,
as: :json
Expand Down

0 comments on commit acf5b66

Please sign in to comment.