Sha256: ab8581f8c2aa8bd5227dadfc45a8b5ae61c9337484e9ce1c1e5cfff6e11edb63
Contents?: true
Size: 1.01 KB
Versions: 18
Compression:
Stored size: 1.01 KB
Contents
require 'spec_helper' module RailsBestPractices::Core describe ModelAssociations do let(:model_associations) { ModelAssociations.new } before :each do model_associations.add_association("Project", "project_manager", "belongs_to") model_associations.add_association("Project", "people", "has_many", "Person") end it "should get model associations" do model_associations.get_association("Project", "project_manager").should == {"meta" => "belongs_to", "class_name" => "ProjectManager"} model_associations.get_association("Project", "people").should == {"meta" => "has_many", "class_name" => "Person"} model_associations.get_association("Project", "unknown").should be_nil end it "should check is model associatiosn" do model_associations.is_association?("Project", "project_manager").should be_true model_associations.is_association?("Project", "people").should be_true model_associations.is_association?("Project", "unknown").should be_false end end end
Version data entries
18 entries across 18 versions & 1 rubygems