You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe "clients/index" do
before(:each) do
assign(:clients, [
stub_model(Client),
stub_model(Client)
])
end
it "renders a list of clients" do
render
end
end
RSpec error message:
Failures:
clients/index renders a list of clients
Failure/Error: render
ActionView::Template::Error:
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
Hi,
I am getting an error in rspec. In the view itself it works without a problem.
Here is how i use it:
config/will_filter/config.yml is not changed.
model client.rb:
belongs_to :license
has_one :license_key
clients_controller.rb:
def index
@Clients = Client.filter(:params => params)
end
index.html.haml:
%p= will_filter_tag(@Clients)
= will_filter_table_tag(@Clients)
index.html.haml_spec.rb:
require 'spec_helper'
describe "clients/index" do
before(:each) do
assign(:clients, [
stub_model(Client),
stub_model(Client)
])
end
it "renders a list of clients" do
render
end
end
RSpec error message:
Failures:
Failure/Error: render
ActionView::Template::Error:
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
./app/views/clients/index.html.haml:1:in `_app_views_clients_index_html_haml__2707070858207547506_2179859460'
./spec/views/clients/index.html.haml_spec.rb:12:in`block (2 levels) in <top (required)>'
I can't find the cause for the failing rspec.
The text was updated successfully, but these errors were encountered: