diff options
author | danielgrippi <danielgrippi@gmail.com> | 2011-08-04 06:02:47 +0400 |
---|---|---|
committer | danielgrippi <danielgrippi@gmail.com> | 2011-08-04 06:02:54 +0400 |
commit | 6a56e3298c36fdb4306433a29611fbf95c23a429 (patch) | |
tree | a2a076336c1d02b38ac210a1976d94b5af6b6d23 /spec | |
parent | 001d4ceafff760656f6fad7d6232da7e18704edb (diff) |
only show connect to services if all services not already connected
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 21 |
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 |