Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AnswersController
- POST #create
- with valid attributes
- saves the new answer in the database
- renders create template
- associates new answer with user created it
- with invalid attributes
- does not save the question
- re-renders create template
- unathorized user tries to create answer
- redirects to sign-in view
- PATCH #update
- assigns the requested answer to @answer
- assigns the question
- author of the answer tries to update the answer
- changes answer attributes
- render update template
- Different user question
- current user tries to update it (FAILED - 1)
- DELETE #destroy
- delete own answer
- delete answer
- render destroy template
- delete not yours answer
- delete answer
- PUT #choose_best
- assigns the answer to @answer
- author chooses the best answer (FAILED - 2)
- another user chooses the best answer
- behaves like rated
- POST #vote_up
- user votes two times
- user votes for someone else's model
- user votes for his model
- POST #vote_down
- user votes two times
- user votes for someone else's model
- user votes for his model
- POST #reset_vote
- user resets his vote
- AttachmentsController
- DELETE #destroy
- User tries to delete his own attachment
- deletes the attachment
- render destroy template
- User tries to delete not his attachment
- delete attachment (FAILED - 3)
- redirect to attachment view
- CommentsController
- POST #create
- with valid attributes
- stores comment in DB
- associates comment with the user
- renders create teamplate
- with invalid parameters
- comment does not save
- renders create teamplate
- OmniauthCallbacksController
- vk
- redirects to root_path (FAILED - 4)
- returns User (FAILED - 5)
- twitter
- redirects to root_path (FAILED - 6)
- returns User (FAILED - 7)
- QuestionsController
- GET #index
- populates an array of all questions
- renders index view
- GET #show
- assigns the requested question to @question
- renders show view
- assigns a new Answer to @answer
- GET #new
- assigns a new Question to @question
- renders new view
- POST #create
- with valid attributes
- associates new question with user created it
- redirects to show view
- with invalid attributes
- does not save the question
- re-renders new view
- unathorized user tries to create answer
- redirects to sign-in view
- DELETE #destroy
- delete own question
- delete question
- redirect to index view
- delete not yours question
- delete question
- PATCH #update
- assigns the requested question to @question
- changes question attributes
- render update template
- Other user
- tries to edit someone else's question
- redirects to question (FAILED - 8)
- behaves like rated
- POST #vote_up
- user votes two times
- user votes for someone else's model
- user votes for his model
- POST #vote_down
- user votes two times
- user votes for someone else's model
- user votes for his model
- POST #reset_vote
- user resets his vote
- UsersController
- GET #setup_email
- temp email
- renders setup_email (FAILED - 9)
- check email
- redirects to root with non temp email
- POST #confirm_email
- temp email
- changes user email (FAILED - 10)
- renders setup_email (FAILED - 11)
- check email
- redirects to verify user
- Failures:
- 1) AnswersController PATCH #update Different user question current user tries to update it
- Failure/Error: expect(flash[:alert]).to eq "You can not update other users' answers"
- expected: "You can not update other users' answers"
- got: nil
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:74:in `block (4 levels) in <top (required)>'
- 2) AnswersController PUT #choose_best author chooses the best answer
- Failure/Error: expect(answer).to be_best
- expected `#<Answer id: 156, body: "Answer body", question_id: 239, created_at: "2018-06-27 14:23:04", updated_at: "2018-06-27 14:23:04", user_id: 399, best: false>.best?` to return true, got false
- # ./spec/controllers/answers_controller_spec.rb:118:in `block (3 levels) in <top (required)>'
- 3) AttachmentsController DELETE #destroy User tries to delete not his attachment delete attachment
- Failure/Error: expect { delete :destroy, params: { id: attachment_2 }, format: :js }.to_not change(Attachment, :count)
- expected #count not to have changed, but did change from 2 to 1
- # ./spec/controllers/attachments_controller_spec.rb:25:in `block (4 levels) in <main>'
- 4) OmniauthCallbacksController vk redirects to root_path
- Failure/Error: get :vkontakte
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/omniauth_callbacks_controller_spec.rb:11:in `block (3 levels) in <main>'
- 5) OmniauthCallbacksController vk returns User
- Failure/Error: get :vkontakte
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/omniauth_callbacks_controller_spec.rb:11:in `block (3 levels) in <main>'
- 6) OmniauthCallbacksController twitter redirects to root_path
- Failure/Error: get :twitter
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/omniauth_callbacks_controller_spec.rb:26:in `block (3 levels) in <main>'
- 7) OmniauthCallbacksController twitter returns User
- Failure/Error: get :twitter
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/omniauth_callbacks_controller_spec.rb:26:in `block (3 levels) in <main>'
- 8) QuestionsController PATCH #update Other user redirects to question
- Failure/Error: expect(response).to redirect_to question_2
- Expected response to be a <200: ok>, but was a <403: Forbidden>
- Response body: .
- Expected: 200
- Actual: 403
- # ./spec/controllers/questions_controller_spec.rb:142:in `block (4 levels) in <main>'
- 9) UsersController GET #setup_email temp email renders setup_email
- Failure/Error: before { get :setup_email, params: { id: @user } }
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/users_controller_spec.rb:7:in `block (4 levels) in <main>'
- 10) UsersController POST #confirm_email temp email changes user email
- Failure/Error: patch :confirm_email, params: { id: @user, user: { email: 'user@email.com'} }
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/users_controller_spec.rb:29:in `block (4 levels) in <main>'
- 11) UsersController POST #confirm_email temp email renders setup_email
- Failure/Error: patch :confirm_email, params: { id: @user, user: { email: 'user@email.com'} }
- CanCan::AuthorizationNotPerformed:
- This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
- # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
- # ./spec/controllers/users_controller_spec.rb:36:in `block (4 levels) in <main>'
- Finished in 1.91 seconds (files took 1.29 seconds to load)
- 69 examples, 11 failures
- Failed examples:
- rspec ./spec/controllers/answers_controller_spec.rb:72 # AnswersController PATCH #update Different user question current user tries to update it
- rspec ./spec/controllers/answers_controller_spec.rb:114 # AnswersController PUT #choose_best author chooses the best answer
- rspec ./spec/controllers/attachments_controller_spec.rb:24 # AttachmentsController DELETE #destroy User tries to delete not his attachment delete attachment
- rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:14 # OmniauthCallbacksController vk redirects to root_path
- rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:18 # OmniauthCallbacksController vk returns User
- rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:29 # OmniauthCallbacksController twitter redirects to root_path
- rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:33 # OmniauthCallbacksController twitter returns User
- rspec ./spec/controllers/questions_controller_spec.rb:139 # QuestionsController PATCH #update Other user redirects to question
- rspec ./spec/controllers/users_controller_spec.rb:9 # UsersController GET #setup_email temp email renders setup_email
- rspec ./spec/controllers/users_controller_spec.rb:28 # UsersController POST #confirm_email temp email changes user email
- rspec ./spec/controllers/users_controller_spec.rb:35 # UsersController POST #confirm_email temp email renders setup_email
Add Comment
Please, Sign In to add comment