Skip to content

Commit a8dd657

Browse files
committed
Add Achievements Model spec on the docs.
1 parent b0b80f8 commit a8dd657

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ to the Rails tests.
3939

4040
### Database
4141

42-
As this is a simple application that don't need great data persistence the default database used when a new Ruby on Rails
43-
application is created has been used: [SQlite3](https://www.sqlite.org/).
42+
As this is a simple application that don't need great data persistence. The [SQlite3](https://www.sqlite.org/) has been used
43+
that is the default database when a new Ruby on Rails application is created.
4444

4545
## Examples
4646

@@ -171,6 +171,32 @@ To run this spec, on the root of the project enter:
171171
rspec spec/controllers/encouragements_controller_spec.rb
172172

173173

174+
#### Achievements Model spec
175+
176+
Spec testing the Achievement model, more specifically the validations, associations, instance methods, db queries using
177+
some helpers like the Shoulda-matchers Gem.
178+
179+
See the following files for a better understanding:
180+
181+
###### Spec file:
182+
183+
* `achievement_spec.rb`=> [spec/models/achievement_spec.rb](spec/models/achievement_spec.rb)
184+
185+
###### Model
186+
187+
* `achievement.rb`=> [app/models/achievement.rb](app/models/achievement.rb)
188+
189+
###### Factory files:
190+
* `achievements.rb` => [spec/factories/achievements.rb](spec/factories/achievements.rb)
191+
* `users.rb` => [spec/factories/users.rb](spec/factories/users.rb)
192+
193+
##### Running
194+
195+
To run this spec, on the root of the project enter:
196+
197+
rspec spec/models/achievement_spec.rb
198+
199+
174200
### Cucumber examples
175201

176202
#### Reading other achievements feature

0 commit comments

Comments
 (0)