Sha256: 7b5c293bb569a51a34060106ab47a6294f15f8f8f9729c6d6b45934fdebbe45f
Contents?: true
Size: 1.02 KB
Versions: 4
Compression:
Stored size: 1.02 KB
Contents
require 'test_plugin_helper' class Api::V2::Compliance::ArfReportsControllerTest < ActionController::TestCase setup do # override validation of policy (puppetclass, lookup_key overrides) ForemanOpenscap::Policy.any_instance.stubs(:valid?).returns(true) @host = FactoryGirl.create(:compliance_host) @report = FactoryGirl.create(:arf_report, :host_id => @host.id, :openscap_proxy => FactoryGirl.create(:smart_proxy, :url => "http://smart-proxy.org:8000")) end test "should get index" do 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 => @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
4 entries across 4 versions & 1 rubygems