Skip to content

wtools/boilertest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Use this gem to simplify your functional tests:

  
    class FooControllerTest < ActionController::TestCase
      def self.editable_attributes
        {
          name: ->(asset){ Faker::Lorem.words.last }
        }
      end

      prepare_stuff = Proc.new do
        @bar = Bar.new
        @asset = Foo.new(name: "Babar", bar: bar)
        @extra_url_params = {parent_id: @bar.slug} 
      end

      test_default_behaviour_for_user nil, :language, {
        index:  :unauthorized,
        new:    :unauthorized,
        create: :unauthorized,
        edit:   :unauthorized,
        update: :unauthorized
      }, {
        editable_attributes: editable_attributes,
        setup: prepare_stuff
      }

      test_default_behaviour_for_user :user, :language, {
        index:  :unauthorized,
        new:    :unauthorized,
        create: :unauthorized,
        edit:   :unauthorized,
        update: :unauthorized
      }, {
        editable_attributes: editable_attributes,
        setup: prepare_stuff
      }
    end
  

TODO: write tests '>_<

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages