Spec your Cells.
This plugin allows you to test your cells easily using RSpec. Basically, it adds a cells example group with a #render_cell
helper.
Cells is Rails’ popular view components framework.
This gem runs with RSpec2 and Rails 3.0, so just add it to your app’s Gemfile
.
group :test do gem "rspec-cells"
Put all your specs under spec/cells
folder. Here is how a simple spec could look like.
describe PostsCell do render_views it "should render the posts count" do render_cell(:posts, :count).should have_selector("p", :content => "4 posts!") end end
Run your examples with
rake spec:cells
If you need more helpers, matchers and stuff, just let us know.
Copyright © 2010, Nick Sutterer
Copyright © 2007-2009, Dmytro Shteflyuk <[email protected]> kpumuk.info
Released under the MIT License.