ensl.org/spec/services/api/v1/users_collection_spec.rb

31 lines
708 B
Ruby
Raw Normal View History

2015-08-17 18:16:32 +00:00
require "spec_helper"
describe Api::V1::UsersCollection do
let(:collection) { Api::V1::UsersCollection.new }
2015-08-17 18:16:32 +00:00
describe "#execute_query" do
describe "when there are users with no teams" do
before do
3.times { create(:user) }
end
2015-08-17 18:16:32 +00:00
it "returns 0 results" do
expect(collection.execute_query.size).to eq(0)
end
end
2015-08-17 18:16:32 +00:00
describe "when there are some users with teams" do
before do
3.times { create(:user_with_team) }
end
2015-08-17 18:16:32 +00:00
it "returns 3 results" do
expect(collection.execute_query.size).to eq(3)
end
2015-08-17 18:16:32 +00:00
it "returns 6 columns" do
expect(collection.execute_query.first.size).to eq(6)
end
end
end
end