Skip to content

Instantly share code, notes, and snippets.

@jomag
Created November 14, 2016 09:24
Show Gist options
  • Save jomag/dff4527cbeb7bb661d67ad63fd150b4b to your computer and use it in GitHub Desktop.
Save jomag/dff4527cbeb7bb661d67ad63fd150b4b to your computer and use it in GitHub Desktop.
This test complains that @controller is nil:
# -*- coding: utf-8 -*-
require 'test_helper'
class Admin::ProductGroupsControllerTest < ActionController::TestCase
test "should show new product group form" do
login_with_role 'employee'
get :new
assert_select "form input[id=product_group_title]"
assert_select "form input[id=product_group_artno]"
assert_select "form input[id=product_group_unit]"
assert_select "form input[id=product_group_vat]"
end
Here's the controller:
# encoding: utf-8
require 'spreadsheet'
class Admin::ProductGroupsController < Admin::BaseController
before_filter :find_product_group, :only => [ 'show', 'edit', 'update', 'destroy', 'preview' ]
helper_method :sort_column, :sort_direction, :search_parameters
layout 'admin/product_groups'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment