Sha256: 97b0e163a5348694663d33fd5b099352192a55e6cc7036fa7dca309b0d7dba7a

Contents?: true

Size: 824 Bytes

Versions: 2

Compression:

Stored size: 824 Bytes

Contents

require 'test_plugin_helper'

class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase
  setup do
    # override validation of policy (puppetclass, lookup_key overrides)
    Scaptimony::Policy.any_instance.stubs(:valid?).returns(true)
  end
  test "should get index" do
    FactoryGirl.create(:arf_report)
    get :index, {}, set_session_user
    response = ActiveSupport::JSON.decode(@response.body)
    assert_not response['results'].empty?
    assert_response :success
  end

  test "should get show" do
    get :show, { :id => FactoryGirl.create(:arf_report).to_param }, set_session_user
    response = ActiveSupport::JSON.decode(@response.body)
    refute response['passed'].blank?
    refute response['failed'].blank?
    refute response['othered'].blank?
    assert_response :success
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_openscap-0.4.3 test/functional/api/v2/compliance/arf_reports_controller_test.rb
foreman_openscap-0.4.2 test/functional/api/v2/compliance/arf_reports_controller_test.rb