Sha256: 4f54b5f004ce67530e1f45ba288f295a53f4205d85d6173959e57053951efa55

Contents?: true

Size: 760 Bytes

Versions: 6

Compression:

Stored size: 760 Bytes

Contents

require "test_helper"

=begin

  What's being tested here?

    - `set_context` which forces the display of items related to domain.

=end

class Admin::ViewsControllerTest < ActionController::TestCase

  setup do
    @request.session[:typus_user_id] = Factory(:typus_user).id
    @site = Factory(:site, :domain => 'test.host')
    Factory(:view, :site => @site)
    Factory(:view)
  end

  teardown do
    reset_session
  end

  should_eventually "get :index returns only views on the current_context" do
    get :index
    assert_response :success
    assert_equal [@site], assigns(:items)
  end

  test "get :new should initialize item in the current_scope" do
    get :new
    assert_response :success
    assert assigns(:item).site.eql?(@site)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typus-3.1.0.rc6 test/app/controllers/admin/views_controller_test.rb
typus-3.1.0.rc5 test/app/controllers/admin/views_controller_test.rb
typus-3.1.0.rc4 test/app/controllers/admin/views_controller_test.rb
typus-3.1.0.rc3 test/app/controllers/admin/views_controller_test.rb
typus-3.1.0.rc2 test/app/controllers/admin/views_controller_test.rb
typus-3.1.0.rc1 test/app/controllers/admin/views_controller_test.rb