Last active
November 20, 2017 06:50
-
-
Save ilyakrasnov/156b2d77677003ac8cf3eb82a276c758 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
FactoryBot.define do | |
factory :user do | |
sequence :email do |n| | |
"sampleEmails#{n}@gmail.com" | |
end | |
password "secretPassword" | |
password_confirmation "secretPassword" | |
end | |
factory :game do | |
association :white_player, factory: :user | |
association :black_player, factory: :user | |
end | |
end | |
... | |
it "should return true because it is obstructed" do | |
game = FactoryBot.create(:game) | |
piece1 = game.pieces.create(position_x: 7, position_y: 7, game_id: game.id) | |
piece2 = game.pieces.create(position_x: 7, position_y: 5, game_id: game.id) | |
variable = piece1.is_obstructed?(game,[7,3]) | |
expect(variable).to eq(true) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment