Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RPM Spec 14.28 KB | None | 0 0
  1. AnswersController
  2.   behaves like voted
  3.     PATCH #vote_up
  4.       Authorized user votes up for the resource
  5.         adds positive vote to the resource (FAILED - 1)
  6.         updates current rating of the resource (FAILED - 2)
  7.     PATCH #vote_down
  8.       Authorized user votes down for the resource
  9.         adds negative vote to the resource (FAILED - 3)
  10.         updates current rating of the resource (FAILED - 4)
  11.     PATCH #revote
  12.       Authorized user revotes for the resource
  13.         deletes vote of the user from resource votes
  14.     vote
  15.       Authorized user tries to vote for his own resource
  16.         does not add positive vote to the resource
  17.       Authorized user tries to vote twice
  18.         changes amount of the votes once (FAILED - 5)
  19.   POST #create
  20.     with valid attributes
  21.       assigns the requested question to @question (FAILED - 6)
  22.       saves the answer for current user (FAILED - 7)
  23.       saves the answer to question in db (FAILED - 8)
  24.       renders create template (FAILED - 9)
  25.     with invalid attributes
  26.       does not save the answer to question in db
  27.       renders create template (FAILED - 10)
  28.   PATCH #update
  29.     authorized user tries to change his answer
  30.       assigns the requested answer to @answer (FAILED - 11)
  31.       changes the answer attributes and saves it in db (FAILED - 12)
  32.       renders update template (FAILED - 13)
  33.     authorized user tries to change NOT his answer
  34.       does not changes answer attributes and save it in db
  35.   DELETE #destroy
  36.     authorized user tries to delete his answer
  37.       assigns requested answer to @answer (FAILED - 14)
  38.       deletes the answer from db (FAILED - 15)
  39.       renders destroy template (FAILED - 16)
  40.     authorized user tries to delete NOT his answer
  41.       does not deletes the answer from db
  42.       re-renders destroy template (FAILED - 17)
  43.   PATCH #best
  44.     author of the question marks the answer as best
  45.       assigns the requested answer to @answer (FAILED - 18)
  46.       adds the best answer mark to @answer (FAILED - 19)
  47.       renders best action template (FAILED - 20)
  48.     other user tries to mark answer as best
  49.       does not marks the answer as best (FAILED - 21)
  50.  
  51. Failures:
  52.  
  53.   1) AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource adds positive vote to the resource
  54.      Failure/Error: expect { patch :vote_up, params: { id: voted, format: :json } }.to change(voted.votes, :count).by(1)
  55.        expected #count to have changed by 1, but was changed by 0
  56.      Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
  57.      # ./spec/support/controller_concerns/voted_spec.rb:12:in `block (4 levels) in <top (required)>'
  58.  
  59.   2) AnswersController behaves like voted PATCH #vote_up Authorized user votes up for the resource updates current rating of the resource
  60.      Failure/Error: expect(voted.rating).to eq 1
  61.      
  62.        expected: 1
  63.             got: 0
  64.      
  65.        (compared using ==)
  66.      Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
  67.      # ./spec/support/controller_concerns/voted_spec.rb:18:in `block (4 levels) in <top (required)>'
  68.  
  69.   3) AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource adds negative vote to the resource
  70.      Failure/Error: expect { patch :vote_down, params: { id: voted, format: :json } }.to change(voted.votes, :count).by(1)
  71.        expected #count to have changed by 1, but was changed by 0
  72.      Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
  73.      # ./spec/support/controller_concerns/voted_spec.rb:28:in `block (4 levels) in <top (required)>'
  74.  
  75.   4) AnswersController behaves like voted PATCH #vote_down Authorized user votes down for the resource updates current rating of the resource
  76.      Failure/Error: expect(voted.rating).to eq -1
  77.      
  78.        expected: -1
  79.             got: 0
  80.      
  81.        (compared using ==)
  82.      Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
  83.      # ./spec/support/controller_concerns/voted_spec.rb:34:in `block (4 levels) in <top (required)>'
  84.  
  85.   5) AnswersController behaves like voted vote Authorized user tries to vote twice changes amount of the votes once
  86.      Failure/Error: expect(response).to have_http_status(422)
  87.        expected the response to have status code 422 but it was 401
  88.      Shared Example Group: "voted" called from ./spec/controllers/answers_controller_spec.rb:8
  89.      # ./spec/support/controller_concerns/voted_spec.rb:68:in `block (4 levels) in <top (required)>'
  90.  
  91.   6) AnswersController POST #create with valid attributes assigns the requested question to @question
  92.      Failure/Error: expect(assigns(:question)).to eq question
  93.      
  94.        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>
  95.             got: nil
  96.      
  97.        (compared using ==)
  98.      # ./spec/controllers/answers_controller_spec.rb:18:in `block (4 levels) in <top (required)>'
  99.  
  100.   7) AnswersController POST #create with valid attributes saves the answer for current user
  101.      Failure/Error: expect { valid_answer_attributes }.to change(@user.answers, :count).by(1)
  102.        expected #count to have changed by 1, but was changed by 0
  103.      # ./spec/controllers/answers_controller_spec.rb:22:in `block (4 levels) in <top (required)>'
  104.  
  105.   8) AnswersController POST #create with valid attributes saves the answer to question in db
  106.      Failure/Error: expect { valid_answer_attributes }.to change(question.answers, :count).by(1)
  107.        expected #count to have changed by 1, but was changed by 0
  108.      # ./spec/controllers/answers_controller_spec.rb:26:in `block (4 levels) in <top (required)>'
  109.  
  110.   9) AnswersController POST #create with valid attributes renders create template
  111.      Failure/Error: expect(response).to render_template :create
  112.        expecting <"create"> but rendering with <[]>
  113.      # ./spec/controllers/answers_controller_spec.rb:31:in `block (4 levels) in <top (required)>'
  114.  
  115.   10) AnswersController POST #create with invalid attributes renders create template
  116.       Failure/Error: expect(response).to render_template :create
  117.         expecting <"create"> but rendering with <[]>
  118.       # ./spec/controllers/answers_controller_spec.rb:44:in `block (4 levels) in <top (required)>'
  119.  
  120.   11) AnswersController PATCH #update authorized user tries to change his answer assigns the requested answer to @answer
  121.       Failure/Error: expect(assigns(:answer)).to eq user_answer
  122.      
  123.         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>
  124.              got: nil
  125.      
  126.         (compared using ==)
  127.       # ./spec/controllers/answers_controller_spec.rb:56:in `block (4 levels) in <top (required)>'
  128.  
  129.   12) AnswersController PATCH #update authorized user tries to change his answer changes the answer attributes and saves it in db
  130.       Failure/Error: expect(user_answer.body).to eq 'edited body'
  131.      
  132.         expected: "edited body"
  133.              got: "body for 14 answer"
  134.      
  135.         (compared using ==)
  136.       # ./spec/controllers/answers_controller_spec.rb:62:in `block (4 levels) in <top (required)>'
  137.  
  138.   13) AnswersController PATCH #update authorized user tries to change his answer renders update template
  139.       Failure/Error: expect(response).to render_template :update
  140.         expecting <"update"> but rendering with <[]>
  141.       # ./spec/controllers/answers_controller_spec.rb:67:in `block (4 levels) in <top (required)>'
  142.  
  143.   14) AnswersController DELETE #destroy authorized user tries to delete his answer assigns requested answer to @answer
  144.       Failure/Error: expect(assigns(:answer)).to eq user_answer
  145.      
  146.         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>
  147.              got: nil
  148.      
  149.         (compared using ==)
  150.       # ./spec/controllers/answers_controller_spec.rb:89:in `block (4 levels) in <top (required)>'
  151.  
  152.   15) AnswersController DELETE #destroy authorized user tries to delete his answer deletes the answer from db
  153.       Failure/Error: expect { delete :destroy, params: { id: user_answer, format: :js } }.to change(Answer, :count).by(-1)
  154.         expected #count to have changed by -1, but was changed by 0
  155.       # ./spec/controllers/answers_controller_spec.rb:93:in `block (4 levels) in <top (required)>'
  156.  
  157.   16) AnswersController DELETE #destroy authorized user tries to delete his answer renders destroy template
  158.       Failure/Error: expect(response).to render_template :destroy
  159.         expecting <"destroy"> but rendering with <[]>
  160.       # ./spec/controllers/answers_controller_spec.rb:98:in `block (4 levels) in <top (required)>'
  161.  
  162.   17) AnswersController DELETE #destroy authorized user tries to delete NOT his answer re-renders destroy template
  163.       Failure/Error: expect(response).to render_template :destroy
  164.         expecting <"destroy"> but rendering with <[]>
  165.       # ./spec/controllers/answers_controller_spec.rb:112:in `block (4 levels) in <top (required)>'
  166.  
  167.   18) AnswersController PATCH #best author of the question marks the answer as best assigns the requested answer to @answer
  168.       Failure/Error: expect(assigns(:answer)).to eq answer
  169.      
  170.         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>
  171.              got: nil
  172.      
  173.         (compared using ==)
  174.       # ./spec/controllers/answers_controller_spec.rb:126:in `block (4 levels) in <top (required)>'
  175.  
  176.   19) AnswersController PATCH #best author of the question marks the answer as best adds the best answer mark to @answer
  177.       Failure/Error: expect(assigns(:answer)).to be_best
  178.         expected nil to respond to `best?`
  179.       # ./spec/controllers/answers_controller_spec.rb:131:in `block (4 levels) in <top (required)>'
  180.  
  181.   20) AnswersController PATCH #best author of the question marks the answer as best renders best action template
  182.       Failure/Error: expect(response).to render_template :best
  183.         expecting <"best"> but rendering with <[]>
  184.       # ./spec/controllers/answers_controller_spec.rb:136:in `block (4 levels) in <top (required)>'
  185.  
  186.   21) AnswersController PATCH #best other user tries to mark answer as best does not marks the answer as best
  187.       Failure/Error: expect(assigns(:answer)).to_not be_best
  188.         expected nil to respond to `best?`
  189.       # ./spec/controllers/answers_controller_spec.rb:145:in `block (4 levels) in <top (required)>'
  190.  
  191. Finished in 1.25 seconds (files took 2.65 seconds to load)
  192. 26 examples, 21 failures
  193.  
  194. Failed examples:
  195.  
  196. 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
  197. 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
  198. 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
  199. 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
  200. 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
  201. rspec ./spec/controllers/answers_controller_spec.rb:16 # AnswersController POST #create with valid attributes assigns the requested question to @question
  202. rspec ./spec/controllers/answers_controller_spec.rb:21 # AnswersController POST #create with valid attributes saves the answer for current user
  203. rspec ./spec/controllers/answers_controller_spec.rb:25 # AnswersController POST #create with valid attributes saves the answer to question in db
  204. rspec ./spec/controllers/answers_controller_spec.rb:29 # AnswersController POST #create with valid attributes renders create template
  205. rspec ./spec/controllers/answers_controller_spec.rb:42 # AnswersController POST #create with invalid attributes renders create template
  206. rspec ./spec/controllers/answers_controller_spec.rb:54 # AnswersController PATCH #update authorized user tries to change his answer assigns the requested answer to @answer
  207. 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
  208. rspec ./spec/controllers/answers_controller_spec.rb:65 # AnswersController PATCH #update authorized user tries to change his answer renders update template
  209. rspec ./spec/controllers/answers_controller_spec.rb:87 # AnswersController DELETE #destroy authorized user tries to delete his answer assigns requested answer to @answer
  210. rspec ./spec/controllers/answers_controller_spec.rb:92 # AnswersController DELETE #destroy authorized user tries to delete his answer deletes the answer from db
  211. rspec ./spec/controllers/answers_controller_spec.rb:96 # AnswersController DELETE #destroy authorized user tries to delete his answer renders destroy template
  212. rspec ./spec/controllers/answers_controller_spec.rb:110 # AnswersController DELETE #destroy authorized user tries to delete NOT his answer re-renders destroy template
  213. 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
  214. 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
  215. rspec ./spec/controllers/answers_controller_spec.rb:134 # AnswersController PATCH #best author of the question marks the answer as best renders best action template
  216. 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