search for: assert_select_rj

Displaying 6 results from an estimated 6 matches for "assert_select_rj".

Did you mean: assert_select_rjs
2007 Feb 06
0
assert_select_rjs with on a page with "page.select" in it
...elect in the RJS to check if it exists. (Is there a better way to do that?) Let''s say we have an RJS page containing: page.select("some_element_that_may_or_may_not_exist").each do |value| page.replace_html value, "something" end Writing a test like this fails: assert_select_rjs "some_element_that_may_or_may_not_exist" do ... end so does: assert_select_rjs do assert_select "some_element_that_may_or_may_not_exist", :count => 1 end I''m assuming this is because of the "page.select". Anyone know of a way to deal with this? t...
2012 May 13
1
is assert_select_rjs deprecated in Rails 3.1 ?
I have seen it in 3.0.9 doc ( http://apidock.com/rails/v3.0.9/ActionDispatch/Assertions/SelectorAssertions/assert_select_rjs ) but it''s not mentioned in the latest guide ( http://guides.rubyonrails.org/testing.html#integration-testing-examples) if deprecated how can I check the view from an Ajax call ( assert_match + gsub could work ? ... ) am I missing any doc ? xhr :get, :change_area, { :area => south_we...
2007 Jun 15
2
Is it still possible to use should_have_rjs
Hi I''ve come back to a Rails project after about a month doing other work, and there''s a lot of changes. I was on the 0.7 branch before and I''ve upgraded to RSpec 1.0.5. I used the spec translator, fixed the cases where it barfed on unusual line contents, and all my model and controller specs now pass. But I''m getting 53 failures on my view specs,
2008 Apr 01
2
Functional Testing - page actions
Pretty simple question, I''ve tried to ajaxify some actions and the first one I did was a delete - def delete_job ..... render :update do |page| page.remove "job_#{id}" end .... end and in my functional test I call this function via post def test.... post :delete_job, :id => 1 assert_response :success ...... end after the assert_response, how do I test that the page
2007 Oct 25
0
specs for RJS
What''s the current best practice for spec''ing (and stubbing) RJS? response.should have_rjs(*args, &block) from rspec_on_rails works well for things that assert_select_rjs supports. But for other things, like say page[:elm].add_class_name :class_name, it''s not clear to me the best way to test for this. I''d love to be able to do something like page[:elm].should_receive(:add_class_name).with(:class_name). Is this possible to do? Thanks! Rspec ro...
2007 Dec 20
3
How-to spec this helper method?...
Hey gang, I have this dead-simple method defined in a helper: def add_category_link(name) link_to_function name do |page| page.insert_html :bottom, :categories, :partial => ''category'', :object => Category.new end end Where, and mostly how, would I spec this? I haven''t been able to find how to stub the rjs in a helper spec, so