assert_method

assert_method(method, content) Instance Public methods Alias for: assert_instance_method

assert_instance_method

assert_instance_method(method, content) Instance Public methods Asserts the given method exists in the given content. When a block is given, it yields the content of the method. assert_file "app/controllers/products_controller.rb" do |controller| assert_instance_method :index, controller do |index| assert_match(/Product\.all/, index) end end assert_method

assert_file

assert_file(relative, *contents) Instance Public methods Asserts a given file exists. You need to supply an absolute path or a path relative to the configured destination: assert_file "config/environment.rb" You can also give extra arguments. If the argument is a regexp, it will check if the regular expression matches the given file content. If it's a string, it compares the file with the given string: assert_file "config/environment.rb", /initialize/ Finally, when a block is giv

assert_field_type

assert_field_type(attribute_type, field_type) Instance Public methods Asserts the given attribute type gets translated to a field type properly: assert_field_type :date, :date_select

assert_field_default_value

assert_field_default_value(attribute_type, value) Instance Public methods Asserts the given attribute type gets a proper default value: assert_field_default_value :string, "MyString"

assert_directory

assert_directory(relative, *contents) Instance Public methods Alias for: assert_file

assert_class_method

assert_class_method(method, content, &block) Instance Public methods Asserts the given class method exists in the given content. This method does not detect class methods inside (class << self), only class methods which starts with âself.â. When a block is given, it yields the content of the method. assert_migration "db/migrate/create_products.rb" do |migration| assert_class_method :up, migration do |up| assert_match(/create_table/, up) end end

wrap_with_namespace

wrap_with_namespace(content) Instance Protected methods

uncountable?

uncountable?() Instance Protected methods

table_name

table_name() Instance Protected methods