Many thanks to Gustavo Sales (aka vatsu) for pointing out this bug and proposing a fix: http://github.com/vatsu/mephisto/commit/e7b0ecaaca4457dd7d542ac218baf979e1b7a190 http://github.com/vatsu/mephisto/commit/fbe32e923ad6dfb963a8311053214b3395aeb37b In order to minimize code duplication in the *.erb files, I've rewritten this code as a helper method.
After experimenting a bit, this looks like a simpler approach. It allows developers to run: rake gems:install ...and it allows users to run: export RAILS_ENV=production rake gems:install Thank you to mat for his work on this!
…nstead of the blog homepage since users have the ability to post to the blog
… address for mailto
Why do we need integration tests? We've been suffering a lot of regressions in the Mephisto UI, because our functional tests don't reach high enough up towards the browser, and whole classes of bugs manage to slip through. What is Webrat? Webrat is a "browser simulator" written in Ruby. It generates a DOM and allows us to fill in forms as though an actual user were interacting with the site. Why Webrat, and not Selenium, Watir, etc? Webrat is recommended by the Cucumber project as the default way to write user stories; it's very fast; and it has a reasonable API. Plus, Webrat actively maintained, and very recent versions of Webrat can be used as a front-end to Selenium. Why Rails integration tests, and not Cucumber stories? Since the people contributing to Mephisto will largely be programmers, I decided to write integration tests using a Ruby-based DSL. Cucumber stories look really interesting, but with no actual clients in the loop, the text-based format is slightly less useful and has a steeper learning curve for programmers. Since we're switching to a new integration testing tool, I moved a bunch of code out of test_helper.rb and put it into our only existing integration test, caching_test.rb. I also switched blueprints.rb to set up user passwords using 'password' and 'password_confirm' (instead of crypted and salted values) to make it easier for tests to override
I'm going to try to rename all the *.rjs files to *.js.rjs. This is trickier than the other renamings, because our unit test coverage isn't perfect, and I'm trying to test everything by hand when possible. So I'm going to do this one directory at a time. Other changes: - The live_preview and _preview stuff wasn't being used. - We didn't have a test case for the 'label' action.
"Plain HTML" is not a very reasonable comment format for end-users, who probably want simple paragraph breaks to do the right thing. So I'm defaulting this to Textile for new sites. I also considered defaulting comments to Markdown, but I didn't like the way that Markdown handled underscores_in_identifiers or * versus _. For very simple stuff, Textile seems very slightly more intuitive than Markdown, though neither is perfect.
J.C. Zhu reported an InvalidAuthenticityToken error when trying to change themes. This was one of several bugs in the theme switching code left over from the Rails 2.2 porting process and the security audit. We needed to convince Ajax.Request to use a GET request when displaying the theme tools, and we needed to properly escape some text in the _tools template. I've also added a test case to make sure we actually render the _tools view successfully.
Sadly, unpacking tzinfo into vendor gems breaks Rails' time zone support and gives the following error when trying to access admin/settings: uninitialized constant TZInfo::Timezone::TimezoneProxy So we're going to instruct the user to install this gem using 'sudo rake gems:install' for now.
We've been installing safe_erb in all ERB templates, which breaks script/generate and lots of other important stuff. But before we can fix this bug in our custom-hacked safe_erb, we need to narrow our Mephisto unit tests down so that they only test ActionView::Template. A safe_erb update will be along shortly.