Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save elias19r/f02ccdc852a97d76c227ff480ed747dd to your computer and use it in GitHub Desktop.
Save elias19r/f02ccdc852a97d76c227ff480ed747dd to your computer and use it in GitHub Desktop.
describe "setting an attribute with value from a parameter" do
context "when parameter key is not present" do
it "does not assume any value for the attribute"
it "does not set the attribute"
end
context "when parameter key is present" do
context "when parameter value is not blank" do
it "sets value to the attribute"
end
context "when parameter value is blank" do
context "when attribute is primary key" do
it "sets the attribute to nil"
end
context "when attribute is not primary key but it allows nil" do
it "sets the attribute to nil"
end
context "when attribute is not primary key and it does not allow nil" do
it "assumes an empty value for the attribute"
it "sets that empty value to the attribute"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment