aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-07-26 16:15:23 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-07-26 16:15:23 +0200
commit1dbf95ed30e66eec2247d38ed7f79b13f8bc0a1d (patch)
tree0a112d62e2e47be74d8efeb2c3ead50b17131077 /site/spec/models/agenda_spec.rb
parentCouncil members can approve summaries (diff)
downloadcouncil-webapp-1dbf95ed30e66eec2247d38ed7f79b13f8bc0a1d.tar.gz
council-webapp-1dbf95ed30e66eec2247d38ed7f79b13f8bc0a1d.tar.bz2
council-webapp-1dbf95ed30e66eec2247d38ed7f79b13f8bc0a1d.zip
Improve tests
use :all_roles and :registered to make users in factory
Diffstat (limited to 'site/spec/models/agenda_spec.rb')
-rw-r--r--site/spec/models/agenda_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb
index b9e564c..738db63 100644
--- a/site/spec/models/agenda_spec.rb
+++ b/site/spec/models/agenda_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe Agenda do
it 'shouldn not allow anyone to create' do
a = Agenda.new
- for u in users_factory(AllRoles)
+ for u in users_factory(:all_roles)
a.should_not be_creatable_by(u)
a.should_not be_destroyable_by(u)
end
@@ -11,14 +11,14 @@ describe Agenda do
it 'shouldn not allow anyone to destory' do
a = Factory(:agenda)
- for u in users_factory(AllRoles)
+ for u in users_factory(:all_roles)
a.should_not be_destroyable_by(u)
end
end
it 'should allow everybody to view' do
a = Factory(:agenda)
- for u in users_factory(AllRoles)
+ for u in users_factory(:all_roles)
a.should be_viewable_by(u)
end
end
@@ -32,7 +32,7 @@ describe Agenda do
(1..4).each { |i| Factory(:approval, :agenda => agenda) }
- for u in users_factory(AllRoles)
+ for u in users_factory(:all_roles)
agenda.should be_viewable_by(u, :summary)
end
end
@@ -49,7 +49,7 @@ describe Agenda do
a = Factory(:agenda)
a.meeting_log = 'changed'
- for u in users_factory(AllRoles)
+ for u in users_factory(:all_roles)
a.should_not be_editable_by(u, :meeting_log)
a.should_not be_updatable_by(u)
end