mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
parent
9a152b8289
commit
1784980e6c
10 changed files with 171 additions and 2 deletions
28
spec/requests/registrar/domains_controller_spec.rb
Normal file
28
spec/requests/registrar/domains_controller_spec.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Registrar::DomainsController, db: true do
|
||||
describe '#index' do
|
||||
before do
|
||||
sign_in_to_registrar_area
|
||||
end
|
||||
|
||||
it 'responds with success' do
|
||||
csv_presenter = instance_double(Registrar::DomainListCSVPresenter, to_s: 'csv')
|
||||
expect(Registrar::DomainListCSVPresenter).to receive(:new).and_return(csv_presenter)
|
||||
|
||||
get registrar_domains_url(format: 'csv')
|
||||
|
||||
expect(response.body).to eq('csv')
|
||||
end
|
||||
|
||||
it 'returns csv' do
|
||||
get registrar_domains_url(format: 'csv')
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
|
||||
def sign_in_to_registrar_area(user: FactoryGirl.create(:api_user))
|
||||
post registrar_sessions_path, { depp_user: { tag: user.username, password: user.password } }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue