在will_paginate-bootstrap gem之后,Rspec测试失败

时间:2013-02-19 11:18:49

标签: ruby-on-rails ruby rspec will-paginate

我安装了will_paginate-bootstrap gem并将其添加到我的模板

<%= will_paginate, renderer: BootstrapPagination::Rails %>

现在我的测试失败了

Failure/Error: visit users_path
     ActionView::Template::Error:
       /Users/user/dev/rails/my/app_rails/app/views/users/index.html.erb:10: syntax error, unexpected tLABEL, expecting '='
       ...end= ( will_paginate, renderer: BootstrapPagination::Rails )...
       ...                               ^
     # <internal:prelude>:10:in `synchronize'
     # ./spec/requests/user_pages_spec.rb:24:in `block (4 levels) in <top (required)>'

这条消息是什么意思?我该如何修复损坏的测试?

2 个答案:

答案 0 :(得分:0)

该代码使用Ruby 1.9哈希语法。你是偶然的1.8岁吗?

答案 1 :(得分:0)

括号已解决问题<%= will_paginate(:renderer => BootstrapPagination::Rails) %>