mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add/edit org code of conduct, as admin
This commit is contained in:
parent
512ad067e1
commit
a6daff8582
6 changed files with 58 additions and 5 deletions
34
spec/features/code_of_conduct_spec.rb
Normal file
34
spec/features/code_of_conduct_spec.rb
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Code of Conduct:' do
|
||||
let!(:organization) { create(:organization) }
|
||||
let(:admin) { create(:admin) }
|
||||
let(:sample_text) { Faker::Lorem.paragraph }
|
||||
|
||||
context 'on an organization' do
|
||||
describe 'as admin' do
|
||||
before { sign_in admin }
|
||||
|
||||
it 'can add and remove' do
|
||||
visit admin_organizations_path
|
||||
within "tr#organization-#{organization.id}" do
|
||||
expect(page).not_to have_css 'i.fa-check'
|
||||
click_on 'Edit'
|
||||
end
|
||||
expect(page).to have_field 'organization[code_of_conduct]', with: ''
|
||||
fill_in 'organization[code_of_conduct]', with: sample_text
|
||||
click_on 'Update Organization'
|
||||
within "tr#organization-#{organization.id}" do
|
||||
expect(page).to have_css 'i.fa-check'
|
||||
click_on 'Edit'
|
||||
end
|
||||
expect(page).to have_field 'organization[code_of_conduct]', with: sample_text
|
||||
fill_in 'organization[code_of_conduct]', with: ''
|
||||
click_on 'Update Organization'
|
||||
within "tr#organization-#{organization.id}" do
|
||||
expect(page).not_to have_css 'i.fa-check'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue