spec/spec_helper.rb in exposure-0.1.1 vs spec/spec_helper.rb in exposure-0.1.2

- old
+ new

@@ -43,13 +43,13 @@ t.column :name, :string t.column :pirate_id, :integer t.column :created_at, :datetime t.column :updated_at, :datetime end - create_table :widgets do |t| - t.column :title, :string - t.column :body, :text + create_table :cannons do |t| + t.column :name, :string + t.column :ship_id, :integer t.column :created_at, :datetime t.column :updated_at, :datetime end create_table :ship_types do |t| t.column :title, :string @@ -57,18 +57,25 @@ t.column :created_at, :datetime t.column :updated_at, :datetime end end +class Cannon < ActiveRecord::Base + belongs_to :ship + def validate + end +end + class Pirate < ActiveRecord::Base has_many :ships validates_length_of :title, :within => 2..100 def validate end end class Ship < ActiveRecord::Base belongs_to :pirate + has_many :cannons def validate end validates_associated :pirate end \ No newline at end of file