Project

General

Profile

« Previous | Next » 

Revision dbaa163e

Added by Alon Goldboim almost 9 years ago

Fixes #11011 - notifications are removed when window is changed

View differences:

app/assets/javascripts/application.js
$(document).on('ContentLoad', function(){onContentLoad()});
Turbolinks.enableProgressBar();
$(window).bind('beforeunload', function() {
$(".jnotify-container").remove();
});
$(function() {
$(document).trigger('ContentLoad');
});
......
e.preventDefault();
$(".role_checkbox").prop('checked', false);
});
$('#login-form').submit(function(e){
$(".jnotify-container").remove();
});
});
test/integration/user_test.rb
assert_submit_button(users_path)
assert page.has_link? 'user12345'
end
context 'javascript test' do
def setup
Capybara.current_driver = Capybara.javascript_driver
end
test "notice is removed after submit pressed" do
visit "/"
fill_in "login_login", :with => users(:admin).login
fill_in "login_password", :with => "badPass"
click_button "Login"
assert page.has_selector?('div.jnotify-message'), "notice wasn't on page after login with bad credentials"
execute_script("$('#login-form').submit(function(e){return false;});")
fill_in "login_login", :with => users(:admin).login
fill_in "login_password", :with => "secret"
click_button "Login"
assert_not page.has_selector?('div.jnotify-message'), "notice wasn't removed after login was clicked"
end
end
end

Also available in: Unified diff