P
Pauli Price
A rails plugin I'm trying to use has the following pattern of failing
tests:
--- unit test file for editor
def setup
create_editor!role => 'author')
end
--- "test factory" method meant to simplify test writing
def create_editor!(attributes = {})
default_attributes = {
# :key => 'value'
}
Editor.create! default_attributes.merge(attributes)
end
Using ruby-debug I have confirmed that the value of attributes is nil
inside create_editor!
What's going on? I don't belief that the plugin creator would have
published it if most of the tests failed.
I can play with the code to figure out how to correctly pass the hash (
I'm a ruby nuby, so the solution is not immediately obvious ) but I'm
curious about why it stopped working.
Any thoughts?
Pauli
tests:
--- unit test file for editor
def setup
create_editor!role => 'author')
end
--- "test factory" method meant to simplify test writing
def create_editor!(attributes = {})
default_attributes = {
# :key => 'value'
}
Editor.create! default_attributes.merge(attributes)
end
Using ruby-debug I have confirmed that the value of attributes is nil
inside create_editor!
What's going on? I don't belief that the plugin creator would have
published it if most of the tests failed.
I can play with the code to figure out how to correctly pass the hash (
I'm a ruby nuby, so the solution is not immediately obvious ) but I'm
curious about why it stopped working.
Any thoughts?
Pauli