1
0
Fork 0

Add more specs

This commit is contained in:
Alex Kotov 2018-12-03 17:23:38 +05:00
parent 6e1edee2d2
commit 6b1a678124
No known key found for this signature in database
GPG key ID: 4E831250F47DE154

View file

@ -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 }