Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authordanielgrippi <danielgrippi@gmail.com>2011-08-04 06:02:47 +0400
committerdanielgrippi <danielgrippi@gmail.com>2011-08-04 06:02:54 +0400
commit6a56e3298c36fdb4306433a29611fbf95c23a429 (patch)
treea2a076336c1d02b38ac210a1976d94b5af6b6d23 /spec
parent001d4ceafff760656f6fad7d6232da7e18704edb (diff)
only show connect to services if all services not already connected
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/application_helper_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index fd05d3631..2c393e36d 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -77,4 +77,25 @@ describe ApplicationHelper do
contacts_link.should == contacts_path
end
end
+
+ describe "#all_services_connected?" do
+ before do
+ AppConfig[:configured_services] = [1, 2, 3]
+
+ def current_user
+ @current_user
+ end
+ @current_user = alice
+ end
+
+ it 'returns true if all networks are connected' do
+ 3.times { |t| @current_user.services << Factory.build(:service) }
+ all_services_connected?.should be_true
+ end
+
+ it 'returns false if not all networks are connected' do
+ @current_user.services.delete_all
+ all_services_connected?.should be_false
+ end
+ end
end