Users have access to sections of the site / functions. For example, there is admin - which can do everything and guest - which has access only to view information.
Now for example, the test looks like this:
feature 'Comments' do context 'User' do scenario 'can add comments to question' scenario 'can add comments to posts' scenario "can't add replies to own comment" context 'Guest' do scenario "can't add comments to question" scenario "can't add comments to posts" end end The question is, is this the right approach, to test different types of roles in the spec about comments? Or, to put these tests in general in a separate section, for example:
spec / user / authorization / comment_spec.rb
Or maybe all this is fundamentally wrong and there is an established pattern for such cases?