Created
September 12, 2014 19:07
-
-
Save elrayle/50d14ba381553107e618 to your computer and use it in GitHub Desktop.
ActiveTriples: Test for set_value deletes all values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "set_value" do | |
it "should add a single value when none exist a priori" do | |
vals = subject.get_values('aggregates') | |
vals << "foo" | |
subject.set_value('aggregates',vals) | |
expect(subject.get_values('aggregates')).to eq ["foo"] | |
end | |
it "should add a single value when one value exists a priority" do | |
subject.aggregates = "foo" | |
vals = subject.get_values('aggregates') | |
vals << "bar" | |
subject.set_value('aggregates',vals) | |
expect(subject.get_values('aggregates')).to eq ["foo","bar"] | |
end | |
it "should not change the value before calling set value" do | |
subject.aggregates = "foo" | |
vals = subject.get_values('aggregates') | |
vals << "bar" | |
expect(subject.get_values('aggregates')).to eq ["foo"] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment