Sha256: 8ad3091d00c438d69f74a422e6ce2d3bfafc889dda3e94ba046e9ced95b59d38

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

require 'ronin/model/targets_product'

require 'spec_helper'
require 'model/models/targets_product_model'

describe Model::TargetsArch do
  it "should define a product relation" do
    relationship = TargetsProductModel.relationships['product']

    relationship.should_not be_nil
    relationship.parent_model.should == Product
  end

  it "should define a relationship with Product" do
    relationship = Product.relationships['targets_product_models']

    relationship.should_not be_nil
    relationship.child_model.should == TargetsProductModel
  end

  it "should provide access to the targeted product" do
    model = TargetsProductModel.new(
      :product => Product.new(:name => 'Toaster')
    )

    model.product.name.should == 'Toaster'
  end

  it "should allow the product to be set via the getter method" do
    model = TargetsProductModel.new
    model.product :name => 'Toaster'

    model.product.name.should == 'Toaster'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-exploits-0.3.1 spec/model/targets_product_spec.rb
ronin-exploits-0.3.0 spec/model/targets_product_spec.rb