2016-11-06 01:20:05 +11:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe TagsController, type: :controller do
|
2016-11-19 09:08:52 +11:00
|
|
|
render_views
|
2016-11-06 01:20:05 +11:00
|
|
|
|
|
|
|
describe 'GET #show' do
|
2016-11-06 08:09:51 +11:00
|
|
|
before do
|
|
|
|
Fabricate(:tag, name: 'test')
|
|
|
|
end
|
|
|
|
|
2016-11-06 01:20:05 +11:00
|
|
|
it 'returns http success' do
|
|
|
|
get :show, params: { id: 'test' }
|
|
|
|
expect(response).to have_http_status(:success)
|
|
|
|
end
|
2017-04-28 23:11:21 +10:00
|
|
|
|
|
|
|
it 'returns http missing for non-existent tag' do
|
|
|
|
get :show, params: { id: 'none' }
|
|
|
|
|
|
|
|
expect(response).to have_http_status(:missing)
|
|
|
|
end
|
2016-11-06 01:20:05 +11:00
|
|
|
end
|
|
|
|
end
|