Open lessless opened 8 years ago
Is that a Cucumber test that only tests a cell in isolation, or retrieves the page via the controller, e.g. GET /comments
?
@apotonick it's the later, with visit new_realty_path
btw, in both development
and test
environments, i.e. when called during regular navigation with a browser and when called during the visit
helper inspired request, cell renders the same string.
Also template engine doesn't matter - it's the same for erb
and slim
.
"<form class=\"simple_form large-9 larger-centered medium-10 medium-centered small-12 columns\" id=\"new_realty\" action=\"/manage/realties\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" />\n \n\n <div class=\"form-section small-12 colunms\">\n <div class=\"row\">\n \n <div class=\"input hidden realty_listing_deal\"><input value=\"rent\" class=\"hidden\" type=\"hidden\" name=\"realty[listing_attributes][deal]\" id=\"realty_listing_attributes_deal\" /></div>\n <div class=\"input string required realty_listing_price medium-6 small-12 columns\"><label class=\"string required\" for=\"realty_listing_attributes_price\">Price <abbr title=\"required\">*</abbr></label><input class=\"string required\" required=\"required\" aria-required=\"true\" placeholder=\"Price\" type=\"text\" name=\"realty[listing_attributes][price]\" id=\"realty_listing_attributes_price\" /></div>\n</div></div>\n</form>"
update: eventually, marking string as html safe helped to put tags on screen
= concept('realty/cell/create', @form).to_s.html_safe
i had the same issue when calling = cell(:foo, model)
instead of (really!) =cell(:foo, model).()
same issue here.
@thedanielhanke Are you very very very sure that this is the case? This would mean that the override in call
works, but the ViewModel#to_s
method is not invoked.
Can anyone override the to_s
method and raise an exception to see if it is called or not?
@apotonick sorry for the delay. it does not happen anymore, iirc it was a result of slim, caching and omitting .()
but i cannot reproduce it now.
Hello,
During Cucumber tests cell's content is rendered as escaped string http://cl.ly/0I0G0c3k2c0i. Gem versions are:
May have relation to https://github.com/apotonick/rspec-cells/issues/21 but this happens within cucumber, not RSpec tests