what’s that @campaign object contain?, if it’s your server, then you
have to just write one mock server,
and i am assuming this code is in some controller.,
get :preview, :device_id => test_device # send what ever you
3gpp’) # write different set of Functional TestCases for your if/else
expected_file_name = "/tmp/test.3gpp"
assert_equal expected_file_name, assigns(:path) # i just
assumed the path variable can be made instance variable.
assert_kind_of String, @response.body # i don't know what put
in place of String here, if you do some google you may get some idea.
and one more thing is you can add some more assertions provided if you
know what’s the 3gp format, so if you want your FT’s(Functional-Test-
cover even the content delivered, then you have to parse the 3gp
file(or find any equivalent Ruby class, [i don’t know any such class])
and write assertions
for response.body to contain like header, tags etc. of 3gp format.
I guess it helps you, sorry if not.