1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
describe FactoryBot::Declaration::Association do
describe "#==" do
context "when the attributes are equal" do
it "the objects are equal" do
declaration = described_class.new(:name, options: true)
other_declaration = described_class.new(:name, options: true)
expect(declaration).to eq(other_declaration)
end
end
context "when the names are different" do
it "the objects are NOT equal" do
declaration = described_class.new(:name, options: true)
other_declaration = described_class.new(:other_name, options: true)
expect(declaration).not_to eq(other_declaration)
end
end
context "when the options are different" do
it "the objects are NOT equal" do
declaration = described_class.new(:name, options: true)
other_declaration = described_class.new(:name, other_options: true)
expect(declaration).not_to eq(other_declaration)
end
end
context "when comparing against another type of object" do
it "the objects are NOT equal" do
declaration = described_class.new(:name)
expect(declaration).not_to eq(:not_a_declaration)
end
end
end
end
|