Last active
November 11, 2016 22:32
-
-
Save memaker/68f462fcf45dd0788c164caf8bd27911 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
# rspec/requests/user_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