measures_controller_spec.rb 616 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Api::V1::Admin::MeasuresController do
  4. render_views
  5. let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
  6. let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
  7. let(:account) { Fabricate(:account) }
  8. before do
  9. allow(controller).to receive(:doorkeeper_token) { token }
  10. end
  11. describe 'POST #create' do
  12. it 'returns http success' do
  13. post :create, params: { account_id: account.id, limit: 2 }
  14. expect(response).to have_http_status(200)
  15. end
  16. end
  17. end