spec/model/targets_arch_spec.rb in ronin-exploits-0.2.1 vs spec/model/targets_arch_spec.rb in ronin-exploits-0.3.0
- old
+ new
@@ -3,10 +3,20 @@
require 'spec_helper'
require 'model/models/targets_arch_model'
describe Model::TargetsArch do
it "should define an arch relation" do
- TargetsArchModel.relationships.has_key?('arch')
+ relationship = TargetsArchModel.relationships['arch']
+
+ relationship.should_not be_nil
+ relationship.parent_model.should == Arch
+ end
+
+ it "should define a relationship with Arch" do
+ relationship = Arch.relationships['targets_arch_models']
+
+ relationship.should_not be_nil
+ relationship.child_model.should == TargetsArchModel
end
it "should provide access to the targeted arch" do
model = TargetsArchModel.new(:arch => Arch.i386)
model.arch.name.should == 'i386'