When an author is created with first name 'Alan', last name 'Turing', and homepage 'http://wikipedia.org/Alan_Turing'
Then an instance of Author should be created
Hints
This feature requests model behavior and should be tested in a model test. Create the test file spec/models/author_spec.rb
and in the describe block, specify type: :model.
In a model test, behavior is tested directly on the model object, e.g.
The author model should have a first_name, last_name and homepage, which are all strings.
It should furthermore have a method name which returns the full name of an author (the first name followed by the last name), e.g. 'Alan Turing'.
To pass your test a Rails model for authors must be created. Rails features generators which make creating things easier. You can answer 'no' when Rails asks if you want to overwrite files, then your edited files stay the way they are.
Help can be found in the following part of the Rails guide.
Additional behavior of models can be specified in the corresponding model's file, e.g. app/models/author.rb using standard Ruby syntax.
Scenario
When an author is created with first name 'Alan', last name 'Turing', and homepage 'http://wikipedia.org/Alan_Turing' Then an instance of Author should be created
Hints
This feature requests model behavior and should be tested in a model test. Create the test file
spec/models/author_spec.rb
and in thedescribe
block, specifytype: :model
.In a model test, behavior is tested directly on the model object, e.g.
The
eq
matcher tests for object equivalence in RSpec. For more general purpose matchers, see this reference.The author model should have a
first_name
,last_name
andhomepage
, which are all strings. It should furthermore have a methodname
which returns the full name of an author (the first name followed by the last name), e.g. 'Alan Turing'.To pass your test a Rails model for authors must be created. Rails features
generators
which make creating things easier. You can answer 'no' when Rails asks if you want to overwrite files, then your edited files stay the way they are. Help can be found in the following part of the Rails guide. Additional behavior of models can be specified in the corresponding model's file, e.g.app/models/author.rb
using standard Ruby syntax.Error
Estimated progress: 11% complete