Add lists/circles index test
This commit is contained in:
parent
59a433a291
commit
7b88422644
2 changed files with 26 additions and 0 deletions
|
@ -21,6 +21,19 @@ describe Api::V1::CirclesController do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #index' do
|
||||||
|
it 'returns http success' do
|
||||||
|
circle_id = circle.id.to_s
|
||||||
|
Fabricate(:circle)
|
||||||
|
get :index
|
||||||
|
expect(response).to have_http_status(200)
|
||||||
|
|
||||||
|
circle_ids = body_as_json.pluck(:id)
|
||||||
|
expect(circle_ids.size).to eq 1
|
||||||
|
expect(circle_ids).to include circle_id
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with the wrong user context' do
|
context 'with the wrong user context' do
|
||||||
|
|
|
@ -21,6 +21,19 @@ describe Api::V1::ListsController do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #index' do
|
||||||
|
it 'returns http success' do
|
||||||
|
list_id = list.id.to_s
|
||||||
|
Fabricate(:list)
|
||||||
|
get :index
|
||||||
|
expect(response).to have_http_status(200)
|
||||||
|
|
||||||
|
list_ids = body_as_json.pluck(:id)
|
||||||
|
expect(list_ids.size).to eq 1
|
||||||
|
expect(list_ids).to include list_id
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with the wrong user context' do
|
context 'with the wrong user context' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue