Move relationship_flow spec to its helper spec

This commit is contained in:
Stephen Caudill 2010-09-25 13:04:20 -04:00
parent 8c6dff35c0
commit 72cefc6265
2 changed files with 12 additions and 22 deletions

View file

@ -1,21 +0,0 @@
# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3. See
# the COPYRIGHT file.
require 'spec_helper'
describe RequestsController do
include RequestsHelper
render_views
before do
@user = Factory.create :user
stub_success("tom@tom.joindiaspora.com")
@tom = Redfinger.finger('tom@tom.joindiaspora.com')
sign_in :user, @user
stub!(:current_user).and_return @user
end
it 'should return the correct tag and url for a given address' do
relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.include?("receive/user").should == true
end
end

View file

@ -7,7 +7,6 @@ require 'spec_helper'
describe RequestsHelper do
before do
stub_success("tom@tom.joindiaspora.com")
stub_success("evan@status.net")
@tom = Redfinger.finger('tom@tom.joindiaspora.com')
@ -20,4 +19,16 @@ describe RequestsHelper do
subscription_mode(@evan).should == :none
end
end
describe "#relationship_flow" do
let(:tom){ Factory(:user, :email => 'tom@tom.joindiaspora.com') }
before do
stub!(:current_user).and_return(tom)
end
it 'should return the correct tag and url for a given address' do
relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.should include("receive/user")
end
end
end