diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-20 16:39:15 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-20 17:02:02 +0300 |
commit | 69eba88532a349111e38f5c17038de3f2953dd5b (patch) | |
tree | fa8a856ba810daf90bc54f7061b376dd5c97d469 /spec/controllers/groups_controller_spec.rb | |
parent | 490cce630f5984d063283537ac42a6f9fbad86e6 (diff) |
Make sure we render events for projects within a group
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index e7631d4d709..5036c1d2226 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -32,6 +32,31 @@ describe GroupsController do end end + describe 'GET #show' do + before do + sign_in(user) + project + end + + context 'as html' do + it 'assigns whether or not a group has children' do + get :show, id: group.to_param + + expect(assigns(:has_children)).to be_truthy + end + end + + context 'as atom' do + it 'assigns events for all the projects in the group' do + create(:event, project: project) + + get :show, id: group.to_param, format: :atom + + expect(assigns(:events)).not_to be_empty + end + end + end + describe 'GET #new' do context 'when creating subgroups', :nested_groups do [true, false].each do |can_create_group_status| |