Add more specs
This commit is contained in:
parent
6e1edee2d2
commit
6b1a678124
1 changed files with 17 additions and 1 deletions
|
@ -3,10 +3,26 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'GET /passports/:id' do
|
||||
before do
|
||||
let!(:passport) { create :confirmed_passport }
|
||||
let(:current_user) { create :user }
|
||||
|
||||
def make_request
|
||||
get "/passports/#{passport.id}"
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in current_user if current_user
|
||||
make_request
|
||||
end
|
||||
|
||||
context 'when no user is authenticated' do
|
||||
let(:current_user) { nil }
|
||||
|
||||
specify do
|
||||
expect(response).to have_http_status :ok
|
||||
end
|
||||
end
|
||||
|
||||
context 'when passport is empty' do
|
||||
let!(:passport) { create :empty_passport }
|
||||
|
||||
|
|
Reference in a new issue