How to test partial


This is the test code. Over here i am trying to test the partial, is it render or not?

I tried to test it with assert_tag, but its giving me an error and the whole dump of th partial. I have never tested partial. So if any body has test partial, please help me with this

def test_update_cloud   get :update_cloud    assert_response(:success)     assert_tag :tag => 'span',attributes => { :id => "notification" } end

One of these must work,

def test_update_cloud    get :update_cloud    assert_response(:success)    assert_tag :tag => 'span', :attributes => { :id => "notification" } end


def test_update_cloud    get :update_cloud    assert_response(:success)    assert_tag :tag => 'span', :attributes => { :id => /notification/ } end

The colon is missing on :attributes, but I see you have it correct in your followup message. Don't retype code; cut and paste.

The assert_tag call is fine, but assert_select is the new sexy way to do this.

In any event, we can't help unless you post the specific error message and identify the specific line that is raising the message. Your test looks OK as written.