Skip to content

Commit

Permalink
test(authentication):
Browse files Browse the repository at this point in the history
- removes commented out spec in votes_controller.spec
[#137599493]
  • Loading branch information
Ologho Cyril Paul committed Feb 1, 2017
1 parent 31888a5 commit e233cb0
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions spec/controllers/votes_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,6 @@
create_list(:answer, 5, user: user2)
end

# context "when user votes another user's resource" do
# before do
# request.headers['Authorization'] = "Token token=#{valid_user_token(user2)}"
# end
#
# it "upvotes another user's resource" do
# # post :upvote, {resource_name: 'questions', resource_id: 1}
# # expect(response.body).to eq "{\"response\":1}"
# # expect(response.status).to eq 200
# end
#
# it "downvotes another user's resource " do
# # post :downvote, {resource_name: 'questions', resource_id: 1}
# # expect(response.body).to eq "{\"response\":-1}"
# # expect(response.status).to eq 200
# end
# end
#
# context "when user votes own resource" do
# before do
# request.headers['Authorization'] = "Token token=#{valid_user_token(user2)}"
# end
#
# it "doesnt downvote resource" do
# # post :downvote, {resource_name: 'answers', resource_id: 1}
# # expect(response.body).to include "You can't vote for your post"
# # expect(response.status).to eq 403
# end
#
# it "doesnt upvote resource" do
# # post :upvote, {resource_name: 'answers', resource_id: 1}
# # expect(response.body).to include "You can't vote for your post"
# # expect(response.status).to eq 403
# end
# end
#
# context "when user cannot vote on resource" do
# before do
# request.headers['Authorization'] = "Token token=#{valid_user_token(user3)}"
# end
#
# it "doesnt upvotes another user's resource" do
# # post :upvote, {resource_name: 'questions', resource_id: 1}
# # expect(response.body).to include "Not qualified to vote"
# # expect(response.status).to eq 403
# end
#
# it "doesnt downvote another user's resource" do
# # post :downvote, {resource_name: 'answers', resource_id: 1}
# # expect(response.body).to include "Not qualified to vote"
# # expect(response.status).to eq 403
# end
# end

context "when user tries to vote with invalid token", invalid_request: true do
# before do
# request.headers['Authorization'] = "Token token=badtoken"
Expand Down

0 comments on commit e233cb0

Please sign in to comment.