Sha256: 3cd9ab42283b20c41149e3a6c0dc08dd036e9d2c3f9ce2421c31f264dfa569e3
Contents?: true
Size: 1.28 KB
Versions: 1
Compression:
Stored size: 1.28 KB
Contents
require "spec_helper" describe ::ActiveRemote::QueryAttributes do subject { ::Author.new } describe "#query_attribute" do it "raises when getting an undefined attribute" do expect { subject.query_attribute(:foobar) }.to raise_error(::ActiveRemote::UnknownAttributeError) end it "is false when the attribute is false" do subject.name = false expect(subject.name?).to eq false end it "is true when the attribute is true" do subject.name = true expect(subject.name?).to eq true end it "is false when the attribute is nil" do subject.name = nil expect(subject.name?).to eq false end it "is true when the attribute is an Object" do subject.name = Object.new expect(subject.name?).to eq true end it "is false when the attribute is an empty string" do subject.name = "" expect(subject.name?).to eq false end it "is true when the attribute is a non-empty string" do subject.name = "Chris" expect(subject.name?).to eq true end it "is false when the attribute is 0" do subject.name = 0 expect(subject.name?).to eq false end it "is true when the attribute is 1" do subject.name = 1 expect(subject.name?).to eq true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
active_remote-5.0.0.pre | spec/lib/active_remote/query_attribute_spec.rb |