-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added feature tests na Feedback Bar (100% coverage) (#375)
Added feature tests na Feedback Bar, closes #162 Co-authored-by: Jan Macek <[email protected]> Co-authored-by: Jano Suchal <[email protected]>
- Loading branch information
1 parent
3af1708
commit 4d68f4c
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.feature 'Feedback Bar', type: :feature, js: true do | ||
|
||
scenario 'User opens feedback bar' do | ||
visit root_path | ||
find('#ga-feedback-bug-report').click | ||
|
||
expect(page.body).to have_text('Nahlásenie chyby') | ||
end | ||
|
||
scenario 'User submits feedback' do | ||
visit root_path | ||
find('#ga-feedback-bug-report').click | ||
fill_in 'bug_what_were_you_doing', with: 'Testing feedback bar' | ||
fill_in 'bug_what_went_wrong', with: 'Testing of feedback bar' | ||
expect_any_instance_of(Recaptcha::Adapters::ControllerMethods).to receive(:verify_recaptcha).and_return(true) | ||
click_button 'Odoslať' | ||
|
||
expect(page).to have_text('Váš podnet bol odoslaný. Ďakujeme.') | ||
end | ||
|
||
scenario 'User submits feedback and Recaptcha is requested' do | ||
visit root_path | ||
find('#ga-feedback-bug-report').click | ||
fill_in 'bug_what_were_you_doing', with: 'Testing feedback bar' | ||
fill_in 'bug_what_went_wrong', with: 'Testing of feedback bar' | ||
expect_any_instance_of(Recaptcha::Adapters::ControllerMethods).to receive(:verify_recaptcha).and_return(false) | ||
click_button 'Odoslať' | ||
|
||
expect(page).to have_text('Prosím, potvrďte, že nie ste robot.') | ||
end | ||
end |