Permalink
Browse files

updating tests to include attribute option

  • Loading branch information...
1 parent 384ef89 commit eb58cbd55400d361c532db1f10de383dba75393c @itsthatguy itsthatguy committed Aug 12, 2014
Showing with 9 additions and 1 deletion.
  1. +5 −0 spec/html2haml_spec.rb
  2. +4 −1 spec/spec_helper.rb
@@ -26,6 +26,11 @@ def app
Crack::JSON.parse(last_response.body)["page"]["haml"].should =~ /%h1 Hello World/
end
+ it "should convert html 2 haml with options via api json" do
+ post '/api.json', {:page => { :html => "<input type='text'>" }, :options => { :html_style_attributes => true } }.to_json, "CONTENT_TYPE" => "application/json"
+ Crack::JSON.parse(last_response.body)["page"]["haml"].should include("%input(type=\"text\"")
+ end
+
it 'should not parse no page param via json' do
post '/api.json'
last_response.body.should == { :status => :error, :message => 'unable to parse json'}.to_json
View
@@ -6,4 +6,7 @@
RSpec.configure do |config|
config.include Rack::Test::Methods
-end
+ config.expect_with :rspec do |c|
+ c.syntax = [:should, :expect]
+ end
+end

0 comments on commit eb58cbd

Please sign in to comment.