Skip to content

Commit

Permalink
Added XML import test for #38
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed Apr 19, 2012
1 parent 26a79fe commit d1ab556
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/functional/templates_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class TemplatesControllerTest < ActionController::TestCase
include Devise::TestHelpers
include ActionDispatch::TestProcess

def setup
request.env["devise.mapping"] = Devise.mappings[:user]
Expand All @@ -17,5 +18,15 @@ def setup
end
assert_redirected_to template_path(actual)
end

test "importing a simple template" do
file = fixture_file_upload("/files/simple_template.xml", 'text/xml')
image = fixture_file_upload("/files/simple_template.xml", 'image')
assert_difference('Template.count', 1) do
put :import, {:xml => file, :image => image}
end
actual = assigns(:template).positions.first
assert_equal( 0.025, actual.left)
end

end

0 comments on commit d1ab556

Please sign in to comment.