Add specs for group edit and deletion

This commit is contained in:
Stan Hu 2016-10-14 00:06:44 -07:00
parent ab2a7a806a
commit 17e23b4c9c
1 changed files with 26 additions and 0 deletions

View File

@ -47,6 +47,32 @@ feature 'Group', feature: true do
end
end
describe 'Group Edit' do
let(:group) { create(:group) }
let(:path) { edit_group_path(group) }
it 'saves new settings' do
expect(group.request_access_enabled).to be_truthy
visit path
find('#group_request_access_enabled').set(false)
click_button 'Save group'
expect(page).to have_content 'successfully updated'
group.reload
expect(group.request_access_enabled).to be_falsey
end
it 'removes group' do
visit path
click_link 'Remove Group'
expect(page).to have_content "scheduled for deletion"
end
end
describe 'description' do
let(:group) { create(:group) }
let(:path) { group_path(group) }