Last active
June 15, 2017 23:57
-
-
Save GiancarlosIO/eb87a8b92440a260a009f1749af92cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my_api/rspec/requests/users_spec.rb | |
require 'rails_helper' | |
RSpec.describe Api::V1::UsersController, type: :request do | |
describe "GET /users" do | |
before :each do | |
FactoryGirl.create_list(:users, 1) | |
get "/api/v1/users" | |
end | |
it { have_http_status(200) } | |
it 'show all users' do | |
json = JSON.parse(response.body) | |
expect(json.length).to eq(User.count) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment