Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AnswersController
- behaves like voted
- PATCH #vote_up
- Authorized user votes up for the resource
- adds positive vote to the resource (FAILED - 1)
- updates current rating of the resource (FAILED - 2)
- PATCH #vote_down
- Authorized user votes down for the resource
- adds negative vote to the resource (FAILED - 3)
- updates current rating of the resource (FAILED - 4)
- PATCH #revote
- Authorized user revotes for the resource
- deletes vote of the user from resource votes
- vote
- Authorized user tries to vote for his own resource
- does not add positive vote to the resource
- Authorized user tries to vote twice
- changes amount of the votes once (FAILED - 5)
- POST #create
- with valid attributes
- assigns the requested question to @question (FAILED - 6)
- saves the answer for current user (FAILED - 7)
- saves the answer to question in db (FAILED - 8)
- renders create template (FAILED - 9)
- with invalid attributes
- does not save the answer to question in db
- renders create template (FAILED - 10)
- PATCH #update
- authorized user tries to change his answer
- assigns the requested answer to @answer (FAILED - 11)
- changes the answer attributes and saves it in db (FAILED - 12)
- renders update template (FAILED - 13)
- authorized user tries to change NOT his answer
- does not changes answer attributes and save it in db
- DELETE #destroy
- authorized user tries to delete his answer
- assigns requested answer to @answer (FAILED - 14)
- deletes the answer from db (FAILED - 15)
- renders destroy template (FAILED - 16)
- authorized user tries to delete NOT his answer
- does not deletes the answer from db
- re-renders destroy template (FAILED - 17)
- PATCH #best
- author of the question marks the answer as best
- assigns the requested answer to @answer (FAILED - 18)
- adds the best answer mark to @answer (FAILED - 19)
- renders best action template (FAILED - 20)
- other user tries to mark answer as best
- does not marks the answer as best (FAILED - 21)
- Failures:
- 1) AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource adds positive vote to the resource
- Failure/Error: expect { patch :vote_up, params: { id: voted, format: :json } }.to change(voted.votes, :count).by(1)
- expected #count to have changed by 1, but was changed by 0
- Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
- # ./spec/support/controller_concerns/voted_spec.rb:12:in `block (4 levels) in <top (required)>'
- 2) AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource updates current rating of the resource
- Failure/Error: expect(voted.rating).to eq 1
- expected: 1
- got: 0
- (compared using ==)
- Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
- # ./spec/support/controller_concerns/voted_spec.rb:18:in `block (4 levels) in <top (required)>'
- 3) AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource adds negative vote to the resource
- Failure/Error: expect { patch :vote_down, params: { id: voted, format: :json } }.to change(voted.votes, :count).by(1)
- expected #count to have changed by 1, but was changed by 0
- Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
- # ./spec/support/controller_concerns/voted_spec.rb:28:in `block (4 levels) in <top (required)>'
- 4) AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource updates current rating of the resource
- Failure/Error: expect(voted.rating).to eq -1
- expected: -1
- got: 0
- (compared using ==)
- Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
- # ./spec/support/controller_concerns/voted_spec.rb:34:in `block (4 levels) in <top (required)>'
- 5) AnswersController behaves like voted vote Authorized user tries to vote twice changes amount of the votes once
- Failure/Error: expect(response).to have_http_status(422)
- expected the response to have status code 422 but it was 401
- Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
- # ./spec/support/controller_concerns/voted_spec.rb:68:in `block (4 levels) in <top (required)>'
- 6) AnswersController POST #create with valid attributes assigns the requested question to @question
- Failure/Error: expect(assigns(:question)).to eq question
- expected: #<Question id: 455, title: "title for 8 question", body: "body for 8 question", created_at: "2017-09-14 07:00:20", updated_at: "2017-09-14 07:00:20", user_id: 999, rating: 0>
- got: nil
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:18:in `block (4 levels) in <top (required)>'
- 7) AnswersController POST #create with valid attributes saves the answer for current user
- Failure/Error: expect { valid_answer_attributes }.to change(@user.answers, :count).by(1)
- expected #count to have changed by 1, but was changed by 0
- # ./spec/controllers/answers_controller_spec.rb:22:in `block (4 levels) in <top (required)>'
- 8) AnswersController POST #create with valid attributes saves the answer to question in db
- Failure/Error: expect { valid_answer_attributes }.to change(question.answers, :count).by(1)
- expected #count to have changed by 1, but was changed by 0
- # ./spec/controllers/answers_controller_spec.rb:26:in `block (4 levels) in <top (required)>'
- 9) AnswersController POST #create with valid attributes renders create template
- Failure/Error: expect(response).to render_template :create
- expecting <"create"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:31:in `block (4 levels) in <top (required)>'
- 10) AnswersController POST #create with invalid attributes renders create template
- Failure/Error: expect(response).to render_template :create
- expecting <"create"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:44:in `block (4 levels) in <top (required)>'
- 11) AnswersController PATCH #update authorized user tries to change his answer assigns the requested answer to @answer
- Failure/Error: expect(assigns(:answer)).to eq user_answer
- expected: #<Answer id: 187, body: "body for 12 answer", question_id: 461, created_at: "2017-09-14 07:00:20", updated_at: "2017-09-14 07:00:20", user_id: 1010, best: false, rating: 0>
- got: nil
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:56:in `block (4 levels) in <top (required)>'
- 12) AnswersController PATCH #update authorized user tries to change his answer changes the answer attributes and saves it in db
- Failure/Error: expect(user_answer.body).to eq 'edited body'
- expected: "edited body"
- got: "body for 14 answer"
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:62:in `block (4 levels) in <top (required)>'
- 13) AnswersController PATCH #update authorized user tries to change his answer renders update template
- Failure/Error: expect(response).to render_template :update
- expecting <"update"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:67:in `block (4 levels) in <top (required)>'
- 14) AnswersController DELETE #destroy authorized user tries to delete his answer assigns requested answer to @answer
- Failure/Error: expect(assigns(:answer)).to eq user_answer
- expected: #<Answer id: 191, body: "body for 19 answer", question_id: 465, created_at: "2017-09-14 07:00:20", updated_at: "2017-09-14 07:00:20", user_id: 1018, best: false, rating: 0>
- got: nil
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:89:in `block (4 levels) in <top (required)>'
- 15) AnswersController DELETE #destroy authorized user tries to delete his answer deletes the answer from db
- Failure/Error: expect { delete :destroy, params: { id: user_answer, format: :js } }.to change(Answer, :count).by(-1)
- expected #count to have changed by -1, but was changed by 0
- # ./spec/controllers/answers_controller_spec.rb:93:in `block (4 levels) in <top (required)>'
- 16) AnswersController DELETE #destroy authorized user tries to delete his answer renders destroy template
- Failure/Error: expect(response).to render_template :destroy
- expecting <"destroy"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:98:in `block (4 levels) in <top (required)>'
- 17) AnswersController DELETE #destroy authorized user tries to delete NOT his answer re-renders destroy template
- Failure/Error: expect(response).to render_template :destroy
- expecting <"destroy"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:112:in `block (4 levels) in <top (required)>'
- 18) AnswersController PATCH #best author of the question marks the answer as best assigns the requested answer to @answer
- Failure/Error: expect(assigns(:answer)).to eq answer
- expected: #<Answer id: 196, body: "body for 24 answer", question_id: 470, created_at: "2017-09-14 07:00:20", updated_at: "2017-09-14 07:00:20", user_id: 1029, best: false, rating: 0>
- got: nil
- (compared using ==)
- # ./spec/controllers/answers_controller_spec.rb:126:in `block (4 levels) in <top (required)>'
- 19) AnswersController PATCH #best author of the question marks the answer as best adds the best answer mark to @answer
- Failure/Error: expect(assigns(:answer)).to be_best
- expected nil to respond to `best?`
- # ./spec/controllers/answers_controller_spec.rb:131:in `block (4 levels) in <top (required)>'
- 20) AnswersController PATCH #best author of the question marks the answer as best renders best action template
- Failure/Error: expect(response).to render_template :best
- expecting <"best"> but rendering with <[]>
- # ./spec/controllers/answers_controller_spec.rb:136:in `block (4 levels) in <top (required)>'
- 21) AnswersController PATCH #best other user tries to mark answer as best does not marks the answer as best
- Failure/Error: expect(assigns(:answer)).to_not be_best
- expected nil to respond to `best?`
- # ./spec/controllers/answers_controller_spec.rb:145:in `block (4 levels) in <top (required)>'
- Finished in 1.25 seconds (files took 2.65 seconds to load)
- 26 examples, 21 failures
- Failed examples:
- rspec './spec/controllers/answers_controller_spec.rb[1:1:1:1:1]' # AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource adds positive vote to the resource
- rspec './spec/controllers/answers_controller_spec.rb[1:1:1:1:2]' # AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource updates current rating of the resource
- rspec './spec/controllers/answers_controller_spec.rb[1:1:2:1:1]' # AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource adds negative vote to the resource
- rspec './spec/controllers/answers_controller_spec.rb[1:1:2:1:2]' # AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource updates current rating of the resource
- rspec './spec/controllers/answers_controller_spec.rb[1:1:4:2:1]' # AnswersController behaves like voted vote Authorized user tries to vote twice changes amount of the votes once
- rspec ./spec/controllers/answers_controller_spec.rb:16 # AnswersController POST #create with valid attributes assigns the requested question to @question
- rspec ./spec/controllers/answers_controller_spec.rb:21 # AnswersController POST #create with valid attributes saves the answer for current user
- rspec ./spec/controllers/answers_controller_spec.rb:25 # AnswersController POST #create with valid attributes saves the answer to question in db
- rspec ./spec/controllers/answers_controller_spec.rb:29 # AnswersController POST #create with valid attributes renders create template
- rspec ./spec/controllers/answers_controller_spec.rb:42 # AnswersController POST #create with invalid attributes renders create template
- rspec ./spec/controllers/answers_controller_spec.rb:54 # AnswersController PATCH #update authorized user tries to change his answer assigns the requested answer to @answer
- rspec ./spec/controllers/answers_controller_spec.rb:59 # AnswersController PATCH #update authorized user tries to change his answer changes the answer attributes and saves it in db
- rspec ./spec/controllers/answers_controller_spec.rb:65 # AnswersController PATCH #update authorized user tries to change his answer renders update template
- rspec ./spec/controllers/answers_controller_spec.rb:87 # AnswersController DELETE #destroy authorized user tries to delete his answer assigns requested answer to @answer
- rspec ./spec/controllers/answers_controller_spec.rb:92 # AnswersController DELETE #destroy authorized user tries to delete his answer deletes the answer from db
- rspec ./spec/controllers/answers_controller_spec.rb:96 # AnswersController DELETE #destroy authorized user tries to delete his answer renders destroy template
- rspec ./spec/controllers/answers_controller_spec.rb:110 # AnswersController DELETE #destroy authorized user tries to delete NOT his answer re-renders destroy template
- rspec ./spec/controllers/answers_controller_spec.rb:124 # AnswersController PATCH #best author of the question marks the answer as best assigns the requested answer to @answer
- rspec ./spec/controllers/answers_controller_spec.rb:129 # AnswersController PATCH #best author of the question marks the answer as best adds the best answer mark to @answer
- rspec ./spec/controllers/answers_controller_spec.rb:134 # AnswersController PATCH #best author of the question marks the answer as best renders best action template
- rspec ./spec/controllers/answers_controller_spec.rb:143 # AnswersController PATCH #best other user tries to mark answer as best does not marks the answer as best
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement