Sha256: 7434f76487105386bdb148b3cd3799c77fe8c7aaa258d247d34a6c40c9fcb3d7
Contents?: true
Size: 1.21 KB
Versions: 20
Compression:
Stored size: 1.21 KB
Contents
require 'test_plugin_helper' class TailoringFilesControllerTest < ActionController::TestCase setup do @tailoring_file = FactoryGirl.create(:tailoring_file) @scap_file = File.new("#{ForemanOpenscap::Engine.root}/test/files/tailoring_files/ssg-firefox-ds-tailoring.xml", 'rb') end test 'index' do get :index, {}, set_session_user assert_template 'index' end test 'new' do get :new, {}, set_session_user assert_template 'new' end test 'edit' do get :edit, { :id => @tailoring_file.id }, set_session_user assert_template 'edit' end test 'create' do uploaded_file = ActionDispatch::Http::UploadedFile.new(:tempfile => @scap_file, :content_type => 'text/xml') uploaded_file.original_filename = 'uploaded-tailoring-file.xml' post :create, { :tailoring_file => { :name => 'some_file', :scap_file => uploaded_file } }, set_session_user assert_redirected_to tailoring_files_url end test 'destroy' do tf = ForemanOpenscap::TailoringFile.first delete :destroy, { :id => tf.id }, set_session_user assert_redirected_to tailoring_files_url refute ForemanOpenscap::TailoringFile.exists?(tf.id) end end
Version data entries
20 entries across 20 versions & 1 rubygems