Skip to content

Commit

Permalink
bump Rails, and fixes for Rails 5.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
matthutchinson committed Jan 17, 2018
1 parent 1b3703a commit cc5b43d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Appraisals
@@ -1,11 +1,11 @@
appraise "rails-3" do
gem "rails", "3.2.22.4"
gem "rails", "3.2.22.5"
end

appraise "rails-4" do
gem "rails", "4.2.7.1"
gem "rails", "4.2.10"
end

appraise "rails-5" do
gem "rails", "5.0.0.1"
gem "rails", "5.1.4"
end
2 changes: 1 addition & 1 deletion acts_as_textcaptcha.gemspec
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

# always test against latest rails version
s.add_development_dependency('rails', '~> 5.0.0.1')
s.add_development_dependency('rails', '~> 5.1.4')

s.add_development_dependency('mime-types')
s.add_development_dependency('bundler')
Expand Down
6 changes: 3 additions & 3 deletions test/textcaptcha_api_test.rb
Expand Up @@ -30,17 +30,17 @@
URI::InvalidURIError
].each do |error|
stub_request(:get, "http://textcaptcha.com/api/xyz").to_raise(error)
ActsAsTextcaptcha::TextcaptchaApi.fetch('xyz').must_equal nil
assert_nil ActsAsTextcaptcha::TextcaptchaApi.fetch('xyz')
end
end

it 'should return nil when body cannot be parsed as XML' do
stub_request(:get, "http://textcaptcha.com/api/jibber").to_return(:body => 'here be gibberish')
ActsAsTextcaptcha::TextcaptchaApi.fetch('jibber').must_equal nil
assert_nil ActsAsTextcaptcha::TextcaptchaApi.fetch('jibber')
end

it 'should return nil when body is empty' do
stub_request(:get, "http://textcaptcha.com/api/empty").to_return(:body => '')
ActsAsTextcaptcha::TextcaptchaApi.fetch('empty').must_equal nil
assert_nil ActsAsTextcaptcha::TextcaptchaApi.fetch('empty')
end
end
2 changes: 1 addition & 1 deletion test/textcaptcha_cache_test.rb
Expand Up @@ -20,6 +20,6 @@
@cache.read('mykey').must_equal [1,2,3]
@cache.delete('mykey')

@cache.read('mykey').must_equal nil
assert_nil @cache.read('mykey')
end
end
8 changes: 4 additions & 4 deletions test/textcaptcha_test.rb
Expand Up @@ -131,17 +131,17 @@

stub_request(:get, %r{http://textcaptcha.com/api/}).to_raise(SocketError)
@comment.textcaptcha
@comment.textcaptcha_question.must_equal nil
@comment.textcaptcha_key.must_equal nil
assert_nil @comment.textcaptcha_question
assert_nil @comment.textcaptcha_key
end

it 'should not generate any question or answer when user defined questions set incorrectly' do
@comment = MovieReview.new

stub_request(:get, %r{http://textcaptcha.com/api/}).to_raise(SocketError)
@comment.textcaptcha
@comment.textcaptcha_question.must_equal nil
@comment.textcaptcha_key.must_equal nil
assert_nil @comment.textcaptcha_question
assert_nil @comment.textcaptcha_key
end
end

Expand Down

0 comments on commit cc5b43d

Please sign in to comment.