Sha256: 668dc3c245bad46c3adf55c691d325d9df9932da9cf6f66d3fbbefaaef8605bd

Contents?: true

Size: 810 Bytes

Versions: 6

Compression:

Stored size: 810 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')
    view = Factory(:view, :site => @site)
    view = Factory(:view)
  end

  teardown do
    @request.session[:typus_user_id] = nil
  end

  test "get :index returns only views on the current_context" do
    get :index
    assert_response :success
    assert_equal [@site.id], assigns(:items).map(&:site_id)
  end

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

end

Version data entries

6 entries across 6 versions & 1 rubygems

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