這很奇怪,我在我的rails應用程序上運行bundle exec guard
,並且我得到一個單獨容器中每個單獨操作的錯誤列表。所有的錯誤都是一樣的,沒有任何意義,這是我得到的所有行動:RSpec在控制器中的每個動作都發生錯誤?
1) PriceProfilesController GET index assigns all price_profiles as @price_profiles
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (1 for 0)
# ./app/controllers/price_profiles_controller.rb:15:in `extend'
2) PriceProfilesController GET show assigns the requested price_profile as @price_profile
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (1 for 0)
# ./app/controllers/price_profiles_controller.rb:15:in `extend'
... and so forth
任何想法是怎麼回事? PriceProfileContainer幾乎是一個標準的腳手架。我應該在哪裏看這裏。 spec文件由腳手架自動生成。
UPDATE ----
這裏是我的控制器代碼的擴展功能:
# GET /price_profiles/1/extend
def extend
@price_profile = PriceProfile.find(params[:id])
@products = Product.all()
@locations = Location.all()
@price_profile_date_range = PriceProfileDateRange.new()
#respond_to do |format|
# format.html # extend.html.erb
#end
end
這就是這麼多了。
我想你會需要來發表您的控制器代碼。基於這個錯誤,看起來在你的'price_profiles_controller'中,你正在調用第15行的extend方法,並且在它沒有期望的地方向它傳遞一個參數。但需要查看代碼才能確定。 –
@GeoffLanotte嗨,請檢查我的更新 – Ali