{"action":"created","issue":{"url":"https://api.github.com/repos/jnicklas/capybara/issues/1523","labels_url":"https://api.github.com/repos/jnicklas/capybara/issues/1523/labels{/name}","comments_url":"https://api.github.com/repos/jnicklas/capybara/issues/1523/comments","events_url":"https://api.github.com/repos/jnicklas/capybara/issues/1523/events","html_url":"https://github.com/jnicklas/capybara/issues/1523","id":80912686,"number":1523,"title":"js: true causing delay in mailers resulting in test failures","user":{"login":"sithara","id":3234964,"avatar_url":"https://avatars.githubusercontent.com/u/3234964?v=3","gravatar_id":"","url":"https://api.github.com/users/sithara","html_url":"https://github.com/sithara","followers_url":"https://api.github.com/users/sithara/followers","following_url":"https://api.github.com/users/sithara/following{/other_user}","gists_url":"https://api.github.com/users/sithara/gists{/gist_id}","starred_url":"https://api.github.com/users/sithara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sithara/subscriptions","organizations_url":"https://api.github.com/users/sithara/orgs","repos_url":"https://api.github.com/users/sithara/repos","events_url":"https://api.github.com/users/sithara/events{/privacy}","received_events_url":"https://api.github.com/users/sithara/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-26T11:03:50Z","updated_at":"2015-05-26T11:27:41Z","closed_at":"2015-05-26T11:09:35Z","body":"```\r\ndescribe 'salary acceptance email' do\r\n  let!(:effective_date)  { Date.current.next_week }\r\n  let(:salary) { FactoryGirl.create(:salary) } \r\n\r\n  it 'displays admin selected effective_date', js: true do\r\n\r\n    page.visit approval_path(salary)\r\n    page.uncheck('default_effective_date')\r\n    select effective_date.year.to_s, from: 'offer_effective_date_date_1i'\r\n    select I18n.t(\"date.month_names\")[effective_date.month] , from: 'offer_effective_date_date_2i'\r\n    select effective_date.day.to_s, from: 'offer_effective_date_date_3i'\r\n    click_on 'Accept'\r\n    #binding.pry or wait_for_ajax - hack to let the test pass\r\n\r\n    expect(mail.body).to include_in_each_part(salary.amount)\r\n    expect(mail.body).to include_in_each_part(effective_date.strftime('%Y-%m-%d'))\r\n  end\r\nend\r\n```\r\n\r\nThere isn't any ajax request in this part of the code except that there is a javascript which hides/displays the ```effective_date date_select tag```. When I add ```js: true``` to the spec mail[=> ActionMailer::Base.deliveries .last] returns nil but if the test is allowed to wait for a second or two things would work fine. How do I fix this without the HACK ! :sob: \r\n\r\nCapybara Version : capybara (1.1.3) \r\nWebkit Version : capybara-webkit (0.13.0)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jnicklas/capybara/issues/comments/105493923","html_url":"https://github.com/jnicklas/capybara/issues/1523#issuecomment-105493923","issue_url":"https://api.github.com/repos/jnicklas/capybara/issues/1523","id":105493923,"user":{"login":"sithara","id":3234964,"avatar_url":"https://avatars.githubusercontent.com/u/3234964?v=3","gravatar_id":"","url":"https://api.github.com/users/sithara","html_url":"https://github.com/sithara","followers_url":"https://api.github.com/users/sithara/followers","following_url":"https://api.github.com/users/sithara/following{/other_user}","gists_url":"https://api.github.com/users/sithara/gists{/gist_id}","starred_url":"https://api.github.com/users/sithara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sithara/subscriptions","organizations_url":"https://api.github.com/users/sithara/orgs","repos_url":"https://api.github.com/users/sithara/repos","events_url":"https://api.github.com/users/sithara/events{/privacy}","received_events_url":"https://api.github.com/users/sithara/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T11:27:41Z","updated_at":"2015-05-26T11:27:41Z","body":"@twalpole :+1:  .."}}