class MyIntegrationTest < ActionController::IntegrationTest
fixtures :all
test “sample test” do
login_as_quentin
get '/my_models/new' #how do I avoid hard-coded paths?
assert_response 200
assert_difference('MyModel.count') do
post '/my_models/create', :my_model => my_models(:one).attributes
#how do I avoid hard-coded paths?
assert_redirected_to ‘/my_models/edit_photos/’ #how do i specify
ID in here?
end
end
end
In my opinion, integration tests are a bit clumsy. Cucumber features
will be easier to work with, and will also address the issues you were
asking about.
In my opinion, integration tests are a bit clumsy. Cucumber features
will be easier to work with, and will also address the issues you were
asking about.