Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Spec your widgets.

tag: v0.9.1

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGES.mkd
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.mkd
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rspec-apotomo.gemspec
README.mkd

RSpec Apotomo

Spec your widgets!

Build Status

This gem allows you to test widgets with Apotomo via RSpec.

Works with Rails 3.x and RSpec 2.

Installation

In your Rails Gemfile add this line:

group :test do
  gem 'rspec-apotomo'
end

Usage

Put specs in the spec/widgets directory.

TODO Add the generator and generator docs.

An example spec could look like the following code.

describe CommentsWidget do
  has_widgets do |root|
    root << widget(:comments)
  end

  it 'renders properly' do
    render_widget(:comments).should == "<h1>No Comment!</h1>"
  end

  it 'responds to :post events' do
    trigger(:post, :comments, :text => "I like you!").should == ["Thanks!"]
  end
end

Running the specs

Run your examples with:

rake spec:widgets

Contributors

LICENSE

Copyright © 2011 Vivisimo, Inc., Christian Höltje, Jake Goulding, Nick Sutterer

Released under the MIT License

Something went wrong with that request. Please try again.