Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added files and tests for a controller and helper.
- Loading branch information
1 parent
fbfc911
commit 94b1a4f
Showing
15 changed files
with
152 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Given(/^an? (.+) exists with an? (.+) of "([^"]*)"$/) do |model, field, value| | ||
factory_name = model.gsub(' ', '_') | ||
Factory factory_name, field => value | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ENV["RAILS_ENV"] ||= "test" | ||
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | ||
|
||
require 'cucumber/formatter/unicode' | ||
require 'cucumber/rails/rspec' | ||
require 'cucumber/rails/world' | ||
require 'cucumber/web/tableish' | ||
|
||
require 'capybara/rails' | ||
require 'capybara/cucumber' | ||
require 'capybara/session' | ||
require 'cucumber/rails/capybara_javascript_emulation' | ||
|
||
Capybara.default_selector = :css | ||
|
||
ActionController::Base.allow_rescue = false | ||
|
||
require 'factory_girl' | ||
require 'factory_girl/step_definitions' | ||
Dir[File.expand_path(File.join(File.dirname(__FILE__),'..','..', | ||
'spec','factories','*.rb'))].each {|f| require f} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Before do |scenario| | ||
Mongoid.master.collections.select {|c| c.name !~ /system/ }.each(&:drop) | ||
end |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
FactoryGirl.define do | ||
factory :match do | ||
port_numbers [9001, 9002] | ||
parameters {} | ||
state '' | ||
pot {} | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
require File.expand_path('../../../lib/application_defs', __FILE__) | ||
|
||
describe ApplicationHelper do | ||
include ApplicationDefs | ||
|
||
describe '#two_player_limit_params' do | ||
it 'returns a game parameter hash filled with all the necessary arguments to start a two-player limit match properly defined to defaults' do | ||
params = {random_seed: 1} | ||
helper.two_player_limit_params(params).should be == ( | ||
{port_number: 18791, match_name: 'default', | ||
game_definition_file_name: GAME_DEFINITION_FILE_NAMES[:two_player_limit_texas_holdem_poker], | ||
number_of_hands: 1, random_seed: params[:random_seed], player_names: 'user, p2'}) | ||
end | ||
end | ||
end |
10 changes: 5 additions & 5 deletions
10
spec/lib/web_application_player_proxy/web_application_player_proxy_spec.rb
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