updated webmock, hopefully fix cucumber
This commit is contained in:
parent
f24b1f1550
commit
fd5aedeb01
4 changed files with 13 additions and 11 deletions
4
Gemfile
4
Gemfile
|
|
@ -97,7 +97,7 @@ gem 'acts-as-taggable-on', '~> 2.2.2'
|
||||||
|
|
||||||
# URIs and HTTP
|
# URIs and HTTP
|
||||||
|
|
||||||
gem 'addressable', '2.2.4', :require => 'addressable/uri'
|
gem 'addressable', '~> 2.2', :require => 'addressable/uri'
|
||||||
gem 'http_accept_language', '~> 1.0.2'
|
gem 'http_accept_language', '~> 1.0.2'
|
||||||
gem 'typhoeus'
|
gem 'typhoeus'
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ group :test do
|
||||||
gem "rspec-rails", "~> 2.9.0"
|
gem "rspec-rails", "~> 2.9.0"
|
||||||
gem 'selenium-webdriver', '2.22.0.rc1'
|
gem 'selenium-webdriver', '2.22.0.rc1'
|
||||||
|
|
||||||
gem 'webmock', :require => false
|
gem 'webmock', '~> 1.7', :require => false
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
gem 'mock_redis'
|
gem 'mock_redis'
|
||||||
|
|
||||||
|
|
|
||||||
10
Gemfile.lock
10
Gemfile.lock
|
|
@ -63,7 +63,7 @@ GEM
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
rack (>= 1.1.0)
|
rack (>= 1.1.0)
|
||||||
addressable (2.2.4)
|
addressable (2.2.8)
|
||||||
airbrake (3.0.9)
|
airbrake (3.0.9)
|
||||||
activesupport
|
activesupport
|
||||||
builder
|
builder
|
||||||
|
|
@ -444,8 +444,8 @@ GEM
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
warden (1.2.0)
|
warden (1.2.0)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
webmock (1.6.2)
|
webmock (1.8.7)
|
||||||
addressable (>= 2.2.2)
|
addressable (>= 2.2.7)
|
||||||
crack (>= 0.1.7)
|
crack (>= 0.1.7)
|
||||||
whenever (0.7.3)
|
whenever (0.7.3)
|
||||||
activesupport (>= 2.3.4)
|
activesupport (>= 2.3.4)
|
||||||
|
|
@ -463,7 +463,7 @@ DEPENDENCIES
|
||||||
activerecord-import (~> 0.2.9)
|
activerecord-import (~> 0.2.9)
|
||||||
acts-as-taggable-on (~> 2.2.2)
|
acts-as-taggable-on (~> 2.2.2)
|
||||||
acts_as_api
|
acts_as_api
|
||||||
addressable (= 2.2.4)
|
addressable (~> 2.2)
|
||||||
airbrake
|
airbrake
|
||||||
asset_sync
|
asset_sync
|
||||||
bootstrap-sass (~> 2.0.2)
|
bootstrap-sass (~> 2.0.2)
|
||||||
|
|
@ -549,7 +549,7 @@ DEPENDENCIES
|
||||||
typhoeus
|
typhoeus
|
||||||
uglifier
|
uglifier
|
||||||
unicorn (~> 4.3.0)
|
unicorn (~> 4.3.0)
|
||||||
webmock
|
webmock (~> 1.7)
|
||||||
whenever
|
whenever
|
||||||
will_paginate
|
will_paginate
|
||||||
yard
|
yard
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ Scenario: Resharing an nsfw post
|
||||||
And I preemptively confirm the alert
|
And I preemptively confirm the alert
|
||||||
And I follow "Reshare"
|
And I follow "Reshare"
|
||||||
And I wait for the ajax to finish
|
And I wait for the ajax to finish
|
||||||
And I follow "Stream"
|
And I go to the home page
|
||||||
And I wait for the ajax to finish
|
|
||||||
Then I should have 2 nsfw posts
|
Then I should have 2 nsfw posts
|
||||||
And I should not see "Sexy Senators Gone Wild!"
|
Then I should not see "Sexy Senators Gone Wild!"
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,18 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe Jobs::HttpMulti do
|
describe Jobs::HttpMulti do
|
||||||
before :all do
|
before :all do
|
||||||
|
WebMock.disable_net_connect!(:allow_localhost => true)
|
||||||
enable_typhoeus
|
enable_typhoeus
|
||||||
end
|
end
|
||||||
after :all do
|
after :all do
|
||||||
disable_typhoeus
|
disable_typhoeus
|
||||||
|
WebMock.disable_net_connect!
|
||||||
end
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@people = [Factory(:person), Factory(:person)]
|
@people = [Factory(:person), Factory(:person)]
|
||||||
@post_xml = Base64.encode64("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH")
|
@post_xml = Base64.encode64("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH")
|
||||||
|
|
||||||
|
|
||||||
@hydra = Typhoeus::Hydra.new
|
@hydra = Typhoeus::Hydra.new
|
||||||
@response = Typhoeus::Response.new(:code => 200, :headers => "", :body => "", :time => 0.2, :effective_url => 'http://foobar.com')
|
@response = Typhoeus::Response.new(:code => 200, :headers => "", :body => "", :time => 0.2, :effective_url => 'http://foobar.com')
|
||||||
@failed_response = Typhoeus::Response.new(:code => 504, :headers => "", :body => "", :time => 0.2, :effective_url => 'http://foobar.com')
|
@failed_response = Typhoeus::Response.new(:code => 504, :headers => "", :body => "", :time => 0.2, :effective_url => 'http://foobar.com')
|
||||||
|
|
@ -71,6 +72,8 @@ describe Jobs::HttpMulti do
|
||||||
person = @people.first
|
person = @people.first
|
||||||
person.url = 'http://remote.net/'
|
person.url = 'http://remote.net/'
|
||||||
person.save
|
person.save
|
||||||
|
|
||||||
|
stub_request(:post, person.receive_url).to_return(:status=>200, :body=>"", :headers=>{})
|
||||||
response = Typhoeus::Response.new(:code => 301,:effective_url => 'https://foobar.com', :headers_hash => {"Location" => person.receive_url.sub('http://', 'https://')}, :body => "", :time => 0.2)
|
response = Typhoeus::Response.new(:code => 301,:effective_url => 'https://foobar.com', :headers_hash => {"Location" => person.receive_url.sub('http://', 'https://')}, :body => "", :time => 0.2)
|
||||||
@hydra.stub(:post, person.receive_url).and_return(response)
|
@hydra.stub(:post, person.receive_url).and_return(response)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue