From be2db47f0269ae0f9fe99bec16c3272f5a741b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Sun, 11 Nov 2012 22:19:01 -0200 Subject: [PATCH] remove unnecesary stuff from specs --- spec/controllers/registrations_controller_spec.rb | 5 ----- spec/controllers/services_controller_spec.rb | 3 --- spec/controllers/status_messages_controller_spec.rb | 4 +--- spec/controllers/users_controller_spec.rb | 5 +---- spec/helpers/layout_helper_spec.rb | 13 +------------ spec/models/reshare_spec.rb | 5 ----- spec/models/status_message_spec.rb | 5 ----- spec/shared_behaviors/taggable.rb | 3 --- 8 files changed, 3 insertions(+), 40 deletions(-) diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 69a5f6059..9d52c4d64 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -52,15 +52,10 @@ describe RegistrationsController do end end - - describe "#create" do context "with valid parameters" do before do AppConfig.settings.enable_registrations = true - end - - before do user = FactoryGirl.build(:user) User.stub!(:build).and_return(user) end diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 9e39a470b..8ce5d8fde 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -17,8 +17,6 @@ describe ServicesController do before do @user = alice - @aspect = @user.aspects.first - sign_in :user, @user @controller.stub!(:current_user).and_return(@user) mock_access_token.stub!(:token => "12345", :secret => "56789") @@ -106,5 +104,4 @@ describe ServicesController do }.should change(@user.services, :count).by(-1) end end - end diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index ac76ad6cc..57121d1c5 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -7,7 +7,6 @@ require 'spec_helper' describe StatusMessagesController do before do @aspect1 = alice.aspects.first - @aspect2 = bob.aspects.first request.env["HTTP_REFERER"] = "" sign_in :user, alice @@ -55,8 +54,7 @@ describe StatusMessagesController do describe '#new' do it 'succeeds' do - get :new, - :person_id => bob.person.id + get :new, :person_id => bob.person.id response.should be_success end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index cc67471f7..a0000c622 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -7,8 +7,6 @@ require 'spec_helper' describe UsersController do before do @user = alice - @aspect = @user.aspects.first - @aspect1 = @user.aspects.create(:name => "super!!") sign_in :user, @user @controller.stub(:current_user).and_return(@user) end @@ -60,6 +58,7 @@ describe UsersController do get :public, :username => @user.username response.should be_redirect end + it 'redirects to a profile page if mobile is requested' do get :public, :username => @user.username, :format => :mobile response.should be_redirect @@ -210,7 +209,6 @@ describe UsersController do Resque.should_receive(:enqueue).with(Jobs::DeleteAccount, anything) delete :destroy, :user => { :current_password => "bluepin7" } end - end describe '#confirm_email' do @@ -252,4 +250,3 @@ describe UsersController do end end end - diff --git a/spec/helpers/layout_helper_spec.rb b/spec/helpers/layout_helper_spec.rb index 0dabf3f2b..f63da634a 100644 --- a/spec/helpers/layout_helper_spec.rb +++ b/spec/helpers/layout_helper_spec.rb @@ -5,18 +5,7 @@ require 'spec_helper' describe LayoutHelper do - include ApplicationHelper - before do - @user = alice - end - describe "#page_title" do - before do - def current_user - @current_user - end - end - context "passed blank text" do it "returns Diaspora*" do page_title.should == pod_name @@ -30,4 +19,4 @@ describe LayoutHelper do end end end -end \ No newline at end of file +end diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index 79b138b84..aedb365d5 100644 --- a/spec/models/reshare_spec.rb +++ b/spec/models/reshare_spec.rb @@ -1,12 +1,7 @@ require 'spec_helper' describe Reshare do - include ActionView::Helpers::UrlHelper include Rails.application.routes.url_helpers - def controller - mock() - end - it 'has a valid Factory' do FactoryGirl.build(:reshare).should be_valid diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 4425c64e0..9fb1700f6 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -5,12 +5,7 @@ require 'spec_helper' describe StatusMessage do - include ActionView::Helpers::UrlHelper include PeopleHelper - include Rails.application.routes.url_helpers - def controller - mock() - end before do @user = alice diff --git a/spec/shared_behaviors/taggable.rb b/spec/shared_behaviors/taggable.rb index ea4957381..1d7efcbc5 100644 --- a/spec/shared_behaviors/taggable.rb +++ b/spec/shared_behaviors/taggable.rb @@ -8,9 +8,6 @@ require 'spec_helper' describe Diaspora::Taggable do shared_examples_for "it is taggable" do include ActionView::Helpers::UrlHelper - include Rails.application.routes.url_helpers - def controller - end def tag_link(s) link_to "##{s}", "/tags/#{s}", :class => 'tag'