Skip to content

Commit

Permalink
template test for #38
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed Apr 6, 2012
1 parent 4401c61 commit 537273b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/functional/templates_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'test_helper'

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

def setup
request.env["devise.mapping"] = Devise.mappings[:user]
end

test "should create template" do
assert_difference('Template.count', 1) do
post :create, {:template => {:name => "leet template", :author => "the bat", :is_hidden => false}}
end
actual = assigns(:template)
actual.media.each do |media|
assert_equal("original", media.key)
end
assert_redirected_to template_path(actual)
end

end

0 comments on commit 537273b

Please sign in to comment.