mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 05:41:00 +00:00
Added some simple integration tests for shout messages
This commit is contained in:
parent
466d180328
commit
1a8ab10005
1 changed files with 26 additions and 0 deletions
26
spec/features/shoutbox/shoutbox_spec.rb
Normal file
26
spec/features/shoutbox/shoutbox_spec.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Shoutbox' do
|
||||
background do
|
||||
@user = create :user
|
||||
sign_in_as @user
|
||||
visit root_path
|
||||
end
|
||||
|
||||
feature 'user creates a shout', js: true do
|
||||
scenario 'shouting with valid content' do
|
||||
shout = rand(100000).to_s
|
||||
fill_in 'shoutbox_text', with: shout
|
||||
click_button 'Shout!'
|
||||
expect(page).to have_content(shout)
|
||||
end
|
||||
|
||||
scenario 'unable to while banned' do
|
||||
@user.bans.create! ban_type: Ban::TYPE_MUTE, expiry: Time.now + 10.days
|
||||
shout = rand(100000).to_s
|
||||
fill_in 'shoutbox_text', with: shout
|
||||
click_button 'Shout!'
|
||||
expect(page).to_not have_content(shout)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue