JQuery Events/live + ScrewUnit = :-(. ScrewUnit swaps the DOM “out from under” the elements that Events/live is watching, which messes with ScrewUnit. Call
dieon the DOM elements that live events are watching.
ScrewUnit + CI + IE = :’-( Also, When ScrewUnit suites become large, they trigger IE’s “slow script” warning, which can freeze your continuous integration build. Check out the Registry Hack to set your own timeout.
We have a fan of Thor in the house: “Map options to a class. Simply create a class with the appropriate annotations, and have options automatically map to functions and parameters.” Which, as is (not) obvious, indicates that Thor is a replacement for rake.
Ask for Help
“Has anyone implemented mutli-table (class table) inheritance in Rails, as apposed to single table inheritance (STI)?”
- There are some plugins that nobody has tried, such as inherits_from
- What about a view to represent the super set of tables and rows?
“We’re looking for a dead-simple, drop-in JS rating or ‘starting’ plugin.”
Check out the start-rating jQuery plugin. Any other suggestions?
Ask for Help
“What’s the best way to get gems for forked repos?”
There was quite a discussion on this. The specific issue is that the team is trying to use Compass (Chris Eppstein gave a talk on Compass at Pivotal on 3/18-look for the future video on our Talks Page.) For the moment, since compass depends on the edge version of sass you must first manually install sass before installing the compass gem.
- One suggestion was to submit a fix for the gem. This is not a good solution in this case since the new version of sass/haml is expected to be released soon, fixing compass and simplifying its installation.
- Pivotal will likely host its own internal gem server at some point to deal with issues like this.
- The Has My Gem Built Yet? service might be useful in some situations, but not for this specific problem.
- Branches + JsUnit + CI + IE = :-( : Apparently it is difficult to manage IE’s cache in CI. One project apparently has a bat file on CI that clears the cache every 30 minutes. Another team solved this by making the cache directory read only. Often browser/OS combinations have some technique for disabling caching.
Ask for Help
“AR attribute appears to be skipped by text field helper?!” Apparently the model method is bypassed by the text field helper if a column of the same name is present in the underlying table. This was experienced in Rails 2.2.
Others have apparently experienced this in the past but a clear answer did not surface.
- Rubymine Build 784 has the Weirdest. Bug. Ever.: This may only be a problem if you work on a mac and you need to enter capital letters in rubymine dialogs like find and replace ;-). Many of us are fans of intellij/rubymine, but we wish they had a better test process. To be fair, rubymine is in public preview, so expect the occasional bug or two.
Here’s the gist of this post: gist.github.com/58876
Ever since I’ve started using Webrat, a lot of the pain of Selenium has gone away
for me. There’s still a little bit of pain though. Part of it is caused by the fact
in your current window under test. Well no more. Here’s a helper:
To use it with Cucumber, do like so:
World do |world| world.extend(SeleniumHelpers) world end
To use it with POS, do like so:
that it’s always going to return a
String, so you may have to massage the output
While Webrat’s DSL for traversing web apps is awesome, I’ve always found the
alternatives (Polonium for example) to not jive well with how I think. They’re
way better than talking directly to Selenium, you’re still locked in to a certain
fit your own style.
Now you can write your tests like so:
Credit should go to Brian Takita, since he did most of the hard work and I just wrote a method. Let me
know if you have any issues or ideas with the helper, and may all your tests be green.
// JSON version 1  => "" // JSON version 2  => """"
We’re not sure if this is a bug or a feature. We’re sticking with JSON version 1 until further notice.
Pivot Adam has a very interesting blog post about functors called Give up the func. Check it out!
Ask for Help
“We were having problems when mocking an ActiveRecord association under Mocha when we called
expectson a method that calls a method.”
The solution was basically to not mock associations.
“Mod_rewrite + SSL was causing problems when redirecting to a subdomain behind SSL.”
A wild-card SSL certificate solves the problem.
The left screen is the editor and the right screen is the “real-time” preview of the Markdown. It is nice because I don’t have to press a preview button to see rendered Markdown. The Markdown is also rendered as I type so I get instantaneous feedback of my changes.
There is also a Save Text Area Firefox addon, which enables me to save/load the contents of a text area to/from a file on the filesystem. Also the Ctrl+s shortcut saves the file.
So when editing Markdown, I:
- Open Firefox and go to http://wmd-editor.com/examples/splitscreen?blank=1
- Load or Save a markdown file by right-clicking the editor screen
- Going to the Text submenu
- Clicking Load or Save As
- Edit the file and see the generated output
Of course, its not a text editor replacement, since the possible text manipulation in Firefox is limited, but the feedback that is provided by WMD is very effective to rapid Markdown editing. I hope this sort of UI becomes more common.
Now if only there were a similar Textile editor…
Ask for Help
It was suggested that perhaps this is a timing issue. Maybe some required JS for the form hasn’t loaded before Selenium is trying the event.
One workaround would be to test only the form submission called by on-click instead of the click itself.