Sha256: 6aaa553d0c6d07e17c531807fbb735a9273dc00ee19ab72005d6108a482b8b1b
Contents?: true
Size: 1019 Bytes
Versions: 17
Compression:
Stored size: 1019 Bytes
Contents
require 'spec_helper' describe RailsBestPractices::Core::ModelAssociations do let(:model_associations) { RailsBestPractices::Core::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
Version data entries
17 entries across 17 versions & 2 rubygems