Project

blind

0.0
No commit activity in last 3 years
No release in over 3 years
No view rendering in controller testing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

= 4.7.4

Runtime

 Project Readme

blind

No view rendering in Rails controller testing.

Installation

As usual, you can install it using rubygems.

$ gem install blind

If you"re using Bundler, add this line to your application"s Gemfile:

gem "blind", group: :test

And then execute:

$ bundle

Usage

Include the Blind module in your controller tests:

class ActionController::TestCase
  include Blind
end

If you want to assert against the contents of the rendered view, you can use the render_views! method:

class HomeControllerTest < ActionController::TestCase
  render_views!

  def test_body
    get :index

    assert_match /content/, response.body
  end
end

Motivation

Check this blog post.