vince94320 / shoulda-kept-assign-to

We miss the assign_to matcher in shoulda-matchers.

Home Page:http://rubygems.org/gems/shoulda-kept-assign-to

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shoulda-Kept-Assign-To

By Tinfoil Security

Build Status

Shoulda-matchers, (official Git repo), removed the assign_to matcher in version 2.0.0. We missed it dearly, enough to bring it back. This gem includes all of the current version of shoulda-matchers, and it adds the 'assign_to' matcher back in, just the way it was before it was mercilessly destroyed.

Example (from shoulda-matchers, v1.5)

describe PostsController, "#show" do
  it { should permit(:title, :body).for(:create) }

  context "for a fictional user" do
    before do
      get :show, :id => 1
    end

    it { should assign_to(:user) }
  end
end

Installation

In Rails 3 and Bundler, add the following to your Gemfile:

group :test do
  gem "shoulda-kept-assign-to"
end

Shoulda will automatically include matchers into the appropriate example groups.

About

We miss the assign_to matcher in shoulda-matchers.

http://rubygems.org/gems/shoulda-kept-assign-to

License:MIT License


Languages

Language:Ruby 100.0%