Commit f0ee9f49c9db63d3f82c46796a209df3c18a048b
1 parent
ae983c5d
Exists in
staging
and in
3 other branches
before deleting breakpoints
Showing
1 changed file
with
8 additions
and
3 deletions
Show diff stats
plugins/serpro_captcha/test/unit/serpro_captcha_verification_test.rb
@@ -90,14 +90,19 @@ class SerproCaptchaVerificationTest < ActiveSupport::TestCase | @@ -90,14 +90,19 @@ class SerproCaptchaVerificationTest < ActiveSupport::TestCase | ||
90 | end | 90 | end |
91 | 91 | ||
92 | should 'perform a vote on an article identified by id' do | 92 | should 'perform a vote on an article identified by id' do |
93 | - login_with_captcha | 93 | + binding.pry |
94 | + pass_captcha @environment.serpro_captcha_verify_uri, @captcha_verification_body | ||
95 | + params = {} | ||
96 | + params[:txtToken_captcha_serpro_gov_br]= @captcha_token | ||
97 | + params[:captcha_text]= @captcha_text | ||
98 | + post "/api/v1/login-captcha?#{params.to_query}" | ||
99 | + json = JSON.parse(last_response.body) | ||
94 | article = create_article('Article 1') | 100 | article = create_article('Article 1') |
95 | params = {} | 101 | params = {} |
102 | + params[:private_token] = json['private_token'] | ||
96 | params[:value] = 1 | 103 | params[:value] = 1 |
97 | - | ||
98 | post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" | 104 | post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" |
99 | json = JSON.parse(last_response.body) | 105 | json = JSON.parse(last_response.body) |
100 | - | ||
101 | assert_not_equal 401, last_response.status | 106 | assert_not_equal 401, last_response.status |
102 | assert_equal true, json['vote'] | 107 | assert_equal true, json['vote'] |
103 | end | 108 | end |