Skip to content

Instantly share code, notes, and snippets.

@memaker
Last active November 11, 2016 22:32
Show Gist options
  • Save memaker/68f462fcf45dd0788c164caf8bd27911 to your computer and use it in GitHub Desktop.
Save memaker/68f462fcf45dd0788c164caf8bd27911 to your computer and use it in GitHub Desktop.
# 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