32 lines
756 B
Ruby
32 lines
756 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Table, type: :model do
|
|
before :all do
|
|
@table = FactoryGirl.create(:table)
|
|
end
|
|
|
|
subject { @table }
|
|
|
|
it { should respond_to :title }
|
|
it { should respond_to :seats }
|
|
it { should respond_to :games }
|
|
it { should respond_to :current_game }
|
|
|
|
it '#title returns a string' do
|
|
expect(@table.title).to match 'Test Table'
|
|
end
|
|
|
|
it '#seats returns Seats collection' do
|
|
expect(@table.seats.class).to match Seat::ActiveRecord_Associations_CollectionProxy
|
|
end
|
|
|
|
it '#games returns Games collection' do
|
|
expect(@table.games.class).to match Game::ActiveRecord_Associations_CollectionProxy
|
|
end
|
|
|
|
it '#current_game returns a Game' do
|
|
expect(@table.current_game.class).to match Game
|
|
end
|
|
|
|
end
|