aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/controllers/general_controller_spec.rb2
-rw-r--r--spec/controllers/user_controller_spec.rb10
2 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 083197d24..61d847cec 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -21,6 +21,8 @@ describe GeneralController, 'when getting the blog feed' do
before do
AlaveteliConfiguration.stub!(:blog_feed).and_return("http://blog.example.com")
+ # Don't call out to external url during tests
+ controller.stub!(:quietly_try_to_open).and_return('')
end
it 'should add a lang param correctly to a url with no querystring' do
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 1d8e3dcc3..b09594b9c 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -66,6 +66,11 @@ end
describe UserController, "when signing in" do
render_views
+ before do
+ # Don't call out to external url during tests
+ controller.stub!(:country_from_ip).and_return('gb')
+ end
+
def get_last_postredirect
post_redirects = PostRedirect.find_by_sql("select * from post_redirects order by id desc limit 1")
post_redirects.size.should == 1
@@ -226,6 +231,11 @@ end
describe UserController, "when signing up" do
render_views
+ before do
+ # Don't call out to external url during tests
+ controller.stub!(:country_from_ip).and_return('gb')
+ end
+
it "should be an error if you type the password differently each time" do
post :signup, { :user_signup => { :email => 'new@localhost', :name => 'New Person',
:password => 'sillypassword', :password_confirmation => 'sillypasswordtwo' }