Skip to content

Commit 4572f34

Browse files
committed
chore: add test
Add test to ensure user sees info message if they try to add organiser without selecting one first also check the user does not see an error page
1 parent 7c4b03a commit 4572f34

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/features/admin/managing_organisers_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@
3939
end
4040
end
4141

42+
scenario 'show flash alert warning message if user clicks add organiser without selecting an organiser from the dropdown' do
43+
chapter_subscriber = Fabricate(:member)
44+
chapter = Fabricate(:chapter_with_groups)
45+
Fabricate(:subscription, member: chapter_subscriber, group: chapter.groups.first)
46+
visit admin_chapter_organisers_path(chapter)
47+
48+
click_on 'Add organiser'
49+
50+
expect(page).to have_content('Please select a member to make organiser.')
51+
expect(current_path).to eq(admin_chapter_organisers_path(chapter))
52+
expect(page.status_code).to eq(200)
53+
end
54+
4255
scenario 'can remove an organiser from a chapter' do
4356
visit admin_chapter_organisers_path(chapter)
4457
organiser_name = chapter.organisers.first.full_name

0 commit comments

Comments
 (0)