0
我正在編寫控制器功能的測試用例,並且我想測試測試用例我寫的測試用例是否正確或者未測試已編寫的測試用例? ??如何在Rspec中測試測試用例
下面的測試案例
describe "#show_bid" do
render_views
before do
bid = FactoryGirl.create(:bid)
get :show_bid, :id => bid.id, :user_email => @user.email, :user_token => @user.authentication_token, :format => :json
end
it "should pass params to show_bid" do
#binding.pry
expect(assigns(:params)[:id]).not_to be_nil
end
it "Request should be get type and their route should be match" do
#binding.pry
expect(assigns(:params)[:action]).to eq("show_bid")
#get "bid_detail"
end
it "response should be 200" do
assert_response :success
end
末
試試這個:'bundle exec rake test' – Deep
但是我測試了測試用例如何檢查我寫的測試用例是否正確?我可以測試特定控制器功能測試用例嗎? –
你可以在'bundle exec rake test test/integration/file_to_test.rb'處提到文件名 – Deep