diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-07-18 23:58:05 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-07-18 23:58:05 +0300 |
commit | b92709eaf4b513d4cf86c6cef0598b9cd1f45f13 (patch) | |
tree | be62b28507e72660a1a5c7ef2efcdc958fbd0dcc /doc/development/gotchas.md | |
parent | 651bf36cc5d485a7c136f93b21b97bc807dd2188 (diff) |
Remove developer documentation about not describing symbols
This is now covered by rubocop-rspec.
Diffstat (limited to 'doc/development/gotchas.md')
-rw-r--r-- | doc/development/gotchas.md | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/doc/development/gotchas.md b/doc/development/gotchas.md index 565d4b33457..c2ca8966a3f 100644 --- a/doc/development/gotchas.md +++ b/doc/development/gotchas.md @@ -3,35 +3,6 @@ The purpose of this guide is to document potential "gotchas" that contributors might encounter or should avoid during development of GitLab CE and EE. -## Do not `describe` symbols - -Consider the following model spec: - -```ruby -require 'rails_helper' - -describe User do - describe :to_param do - it 'converts the username to a param' do - user = described_class.new(username: 'John Smith') - - expect(user.to_param).to eq 'john-smith' - end - end -end -``` - -When run, this spec doesn't do what we might expect: - -```sh -spec/models/user_spec.rb|6 error| Failure/Error: u = described_class.new NoMethodError: undefined method `new' for :to_param:Symbol -``` - -### Solution - -Except for the top-level `describe` block, always provide a String argument to -`describe`. - ## Do not assert against the absolute value of a sequence-generated attribute Consider the following factory: |