Git Product home page Git Product logo

assert2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

assert2's Issues

Using assert2 for view testing

Hi, I don't seem to be able to use assert2 within ActionView::TestCase without a controller.

# test_helper.rb
...
require 'action_view/test_case'
require 'nokogiri'
require 'assert2'
require 'assert2/xhtml'
...

# my_tests.rb
should 'not blow' do
     erb = <<-ERB
        <% form_for :post, @post, :url => '/do' do |f| %>
          <%= f.text_field :title, :class => 'title' %>
        <% end %>
      ERB

      assert_xml render(:inline => erb) do 
         form do
            text_field
         end
      end
 end

I get

   NoMethodError: undefined method `helpers' for nil:NilClass 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.0/lib/action_view/test_case.rb:201:in `method_missing' 
       ./test/test_dry_forms.rb:21:in `__bind_1285809186_620305' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/shoulda-2.11.3/lib/shoulda/context.rb:382:in `call' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/shoulda-2.11.3/lib/shoulda/context.rb:382:in `test: helper method rendering should render check_box with custom markup and display h    uman_attribute_name. ' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.0/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.0/lib/active_support/testing/setup_and_teardown.rb:67:in `run' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.0/lib/active_support/callbacks.rb:423:in `_run_setup_callbacks' 
       /home/vermelho/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.0/lib/active_support/testing/setup_and_teardown.rb:65:in `run'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.