Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

This project had been moved

Check the new repository at

Rspec Cells

This plugin allows you to test your cells easily using RSpec. Basically, it adds an example group especially for cells, with several helpers to perform cells rendering.

If you are not sure what is cells, please visit its home page:


If you’re using Rails 2.1, you can simply use “script/plugin”. It will export all the code from GitHub into “vendor/plugins”:

script/plugin install git://

If you are using Rails prior to 2.1, use the following:

cd vendor/plugins
git clone git://
rm -rf rspec-cells/.git
cd ../..

To continuously track meta-tags development, it’s probably best to install it as a plugin using some vendor branch management tool like Braid:

gem install evilchelu-braid

Using Braid to add a Rails plugin is simple:

# (make sure you've committed everything first)
braid add -p git://

# now you should have the library in vendor/plugins/rspec-cells

After that is done, add following line into your spec_helper.rb:

require 'spec/cells'


Put all your cells specs under spec/cells folder. Here is how spec looks like in general:

describe VideoCell do

  context '.videos' do
    it 'should initialize :videos variable' do
      params[:id] = 10
      session[:user_id] = 20
      opts[:opt] = 'value'
      result = render_cell :videos, { :videos => [] }, :slug => 'hello'
      result.should have_tag('div', :class => :videos)

Please note: when you don’t pass a cell to describe, like this:

describe ThingsCell do

then you must provide a cell_name within the context of your cell specs:

describe "ThingCell" do
  cell_name :thing

In your spec you can use render_cell method to perform cell rendering.

By default rendering will not be performed, only code from cell class will be called. To do rendering, add integrate_views! statement in your describe block (just like you do for controllers).

From your spec you have access to several variables:

  • opts — options being passed to cell.

  • params — request parameters.

  • session — current session.

  • request — request object.

  • assigns — an array of cell instance variables.

Who are the authors?

This plugin has been created in for our internal use and then the sources were opened for other people to use. All the code in this package has been developed by Dmytro Shteflyuk for and is released under the MIT license. For more details, see the MIT-LICENSE file.


  • Dmytro Shteflyuk (author) <>


A library for testing applications that are using Cells in RSpec.







No releases published


No packages published