Fixes that in the XmlPaylod rspec ".entity_class_name" was mistakenly

put inside the ".unpack" section
This commit is contained in:
cmrd Senya 2015-11-11 17:07:20 +03:00
parent 3e8b1fa7f2
commit 9fd2b048e6

View file

@ -141,33 +141,33 @@ XML
expect(entity.asdf).to eq("QWERT") expect(entity.asdf).to eq("QWERT")
end end
end end
end
describe ".entity_class_name" do describe ".entity_class_name" do
it "should parse a single word" do it "should parse a single word" do
expect(Salmon::XmlPayload.send(:entity_class_name, "entity")).to eq("Entity") expect(Salmon::XmlPayload.send(:entity_class_name, "entity")).to eq("Entity")
end end
it "should parse with underscore" do it "should parse with underscore" do
expect(Salmon::XmlPayload.send(:entity_class_name, "test_entity")).to eq("TestEntity") expect(Salmon::XmlPayload.send(:entity_class_name, "test_entity")).to eq("TestEntity")
end end
it "raises an error when the entity name contains special characters" do it "raises an error when the entity name contains special characters" do
expect { expect {
Salmon::XmlPayload.send(:entity_class_name, "te.st-enti/ty") Salmon::XmlPayload.send(:entity_class_name, "te.st-enti/ty")
}.to raise_error Salmon::InvalidEntityName, "'te.st-enti/ty' is invalid" }.to raise_error Salmon::InvalidEntityName, "'te.st-enti/ty' is invalid"
end end
it "raises an error when the entity name contains upper case letters" do it "raises an error when the entity name contains upper case letters" do
expect { expect {
Salmon::XmlPayload.send(:entity_class_name, "TestEntity") Salmon::XmlPayload.send(:entity_class_name, "TestEntity")
}.to raise_error Salmon::InvalidEntityName, "'TestEntity' is invalid" }.to raise_error Salmon::InvalidEntityName, "'TestEntity' is invalid"
end end
it "raises an error when the entity name contains numbers" do it "raises an error when the entity name contains numbers" do
expect { expect {
Salmon::XmlPayload.send(:entity_class_name, "te5t_ent1ty_w1th_number5") Salmon::XmlPayload.send(:entity_class_name, "te5t_ent1ty_w1th_number5")
}.to raise_error Salmon::InvalidEntityName, "'te5t_ent1ty_w1th_number5' is invalid" }.to raise_error Salmon::InvalidEntityName, "'te5t_ent1ty_w1th_number5' is invalid"
end
end end
end end
end end