From e9930da9f1e5074b37bbc5b276ea4c5b9366abd8 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 9 Mar 2012 08:06:25 -0500 Subject: [PATCH] Stubbing in model for mash tournaments --- rails/map-mash/app/models/mash_tournament.rb | 2 ++ .../20120309130609_create_mash_tournaments.rb | 13 +++++++++++++ rails/map-mash/spec/fixtures/mash_tournaments.yml | 7 +++++++ rails/map-mash/spec/models/mash_tournament_spec.rb | 13 +++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 rails/map-mash/app/models/mash_tournament.rb create mode 100644 rails/map-mash/db/migrate/20120309130609_create_mash_tournaments.rb create mode 100644 rails/map-mash/spec/fixtures/mash_tournaments.yml create mode 100644 rails/map-mash/spec/models/mash_tournament_spec.rb diff --git a/rails/map-mash/app/models/mash_tournament.rb b/rails/map-mash/app/models/mash_tournament.rb new file mode 100644 index 0000000..f5c275a --- /dev/null +++ b/rails/map-mash/app/models/mash_tournament.rb @@ -0,0 +1,2 @@ +class MashTournament < ActiveRecord::Base +end diff --git a/rails/map-mash/db/migrate/20120309130609_create_mash_tournaments.rb b/rails/map-mash/db/migrate/20120309130609_create_mash_tournaments.rb new file mode 100644 index 0000000..dcadc75 --- /dev/null +++ b/rails/map-mash/db/migrate/20120309130609_create_mash_tournaments.rb @@ -0,0 +1,13 @@ +class CreateMashTournaments < ActiveRecord::Migration + def self.up + create_table :mash_tournaments do |t| + t.integer :requester_id + + t.timestamps + end + end + + def self.down + drop_table :mash_tournaments + end +end diff --git a/rails/map-mash/spec/fixtures/mash_tournaments.yml b/rails/map-mash/spec/fixtures/mash_tournaments.yml new file mode 100644 index 0000000..998d51c --- /dev/null +++ b/rails/map-mash/spec/fixtures/mash_tournaments.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +one: + requester_id: 1 + +two: + requester_id: 1 diff --git a/rails/map-mash/spec/models/mash_tournament_spec.rb b/rails/map-mash/spec/models/mash_tournament_spec.rb new file mode 100644 index 0000000..dfde883 --- /dev/null +++ b/rails/map-mash/spec/models/mash_tournament_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe MashTournament do + before(:each) do + @valid_attributes = { + :requester_id => 1 + } + end + + it "should create a new instance given valid attributes" do + MashTournament.create!(@valid_attributes) + end +end