Permalink
Browse files

Use view helper to instead of hard coding the stylesheet path.

  • Loading branch information...
1 parent ef16db5 commit 3969436d23b0f7be3fcb72e09d731397d744a8a1 @jasoncodes jasoncodes committed Nov 28, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 spec/requests/assets_spec.rb
@@ -1,8 +1,15 @@
require 'spec_helper'
describe 'stylesheet', :type => :request do
+ include RSpec::Rails::HelperExampleGroup
+
+ def stylesheet_path
+ html = helper.stylesheet_link_tag 'postmarkdown/postmarkdown'
+ Nokogiri::HTML.fragment(html).at('link')[:href]
+ end
+
it 'should be served' do
- visit '/stylesheets/postmarkdown/postmarkdown.css'
+ visit stylesheet_path
page.source.should match /font-family:/
page.source.should match /}\s*\z/
end

0 comments on commit 3969436

Please sign in to comment.