Stubbing in model for mash tournaments
This commit is contained in:
parent
cc0cd9e8cd
commit
e9930da9f1
2
rails/map-mash/app/models/mash_tournament.rb
Normal file
2
rails/map-mash/app/models/mash_tournament.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class MashTournament < ActiveRecord::Base
|
||||
end
|
@ -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
|
7
rails/map-mash/spec/fixtures/mash_tournaments.yml
vendored
Normal file
7
rails/map-mash/spec/fixtures/mash_tournaments.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
requester_id: 1
|
||||
|
||||
two:
|
||||
requester_id: 1
|
13
rails/map-mash/spec/models/mash_tournament_spec.rb
Normal file
13
rails/map-mash/spec/models/mash_tournament_spec.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user