Hey everyone,
I'm using namespaced models inside my slice and really also in my main
app. Now when I use merb-helpers, form_for in this case, it inferes
the HTML ids for Community::Comment as community::comment. When trying
to write a spec for this like so:
@response.should have_selector("input#community::comment_body")
nokogiri gives me:
parse error on value ":" (":")
I did a little research and found out the following:
The way I understand
http://www.w3.org/TR/REC-html40/types.html#type-name , it explicitly
states that it's legal to have any number of : characters inside the
HTML id attribute? But
http://www.w3.org/TR/css3-selectors/#pseudo-elements introduces the
pseudo-element that explicitly uses the :: character sequence.
http://www.w3.org/TR/css3-selectors/#id-selectors doesn't explicitly
define what's allowed as identifier, but mentions that it must be one.
So the way I see it, if it isn't really possible to have the ::
sequence in css3 id selectors, I would consider merb's current html id
inference mechanism "kind of buggy" for namespaced models? I say "kind
of" because there is a quite simple workaround for this situation. The
above selector can easily be rewritten as:
@response.should have_selector("input[id='community::comment_body']")
which works fine.
However, I would like to be able to use standard CSS3 id-selectors
inside my specs no matter if I decide to organize my models within
modules. I somehow think that the way I organize my ruby classes with
modules should have no influence on the CSS3 selectors I can use
inside my specs.
Opinions?
cheers
snusnu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---