[rspec-users] How can I test the values of css style attributes assigned to a div

Tom Hoen thoen at edgevaleinteractive.com
Wed Oct 21 09:08:57 EDT 2009

My site allows users to change the backround color (among other things) for
their page. These values are stored in database. 


Their choices (or the default) are placed on the page using a <style> block
at the end of the <head> block in the layout. Here is what the style block
looks like. 


<% if !!school %>


            div#header {

                  color: #<%= (!!school.school_name_color and
!school.school_name_color.blank?) ? school.school_name_color : "ffffff"  %>;

                  background-color: #<%= (!!school.header_color and
!school.header_color.blank?) ? school.header_color : "6FA9C7"  %>;


            div#header a {

                  color: #<%= (!!school.school_name_color and
!school.school_name_color.blank?) ? school.school_name_color : "ffffff"  %>;



<% end %>


Can anyone suggest how to verify that the <div id='header'> is assigned the
css attribute color: #ffffff or color: #<% school.header_color%>. 






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20091021/7ed0f17d/attachment-0001.html>

More information about the rspec-users mailing list