Sha256: b627a73df20cad833bf75f443c197f55d51e078e184bd140b7ed46589d58bea9

Contents?: true

Size: 945 Bytes

Versions: 7

Compression:

Stored size: 945 Bytes

Contents

require 'test_helper'
require 'mocha/setup'

class DiscoversControllerTest < ActionController::TestCase
  setup :initialize_host

  def test_index
    get :index, {}, set_session_user
    assert_response :success
  end

  def test_index_json
    get :index, {:format => "json"}, set_session_user
    domain = ActiveSupport::JSON.decode(@response.body)
    assert_response :success
  end

  def test_add_entry_to_nav_menu
    get :index, {}, set_session_user
    assert_tag :tag => 'div',
      :attributes => { :class => "nav-collapse collapse nav2" },
      :child => { :tag => 'ul',
        :child => { :tag => 'li',
          :child => { :tag => 'ul',
            :child => { :tag => 'li',
              :child => {
                :tag => 'a',
                :attributes => {:href => '/discovers'}
              }
            }
          }
        }
      }
  end

  private
  def initialize_host
    User.current = users(:admin)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_discovery-1.1.1 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.2 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.0 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.0.rc4 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.0.rc3 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.0.rc2 test/functional/discovers_controller_test.rb
foreman_discovery-1.0.0.rc1 test/functional/discovers_controller_test.rb