Methods to remove e.g. order or conditions from an existing scope chain.
Never name your shared example group *_spec.rb. Otherwise rspec will try to load your example group as a spec and you will get the error above.
Look Ma, no images!
In Selenium features the server and client are running in separate processes. Therefore when mocking time with a tool like Timecop, the browser controlled by Selenium will still see the unmocked system time.
We use SinonJS in combination with the Timecop gem to synchronize the local browser time to the time currently mocked with
To integrate those two, we include and act…
I was using single table inheritance lately and experienced the problem that a parent class did not know about its subclasses in development mode. The inheritance structure was like follows:
class Event < ActiveRecord::Base end class GlobalEvent < Event end class NewRegistrationEvent < GlobalEvent end class ConsultingRequestEvent < GlobalEvent end
When I tried to load all global events in a controller, all I recieved by
GlobalEvent.all was an empty set even though there were some new registr…
No one wants to cry over regression issues in views; does testing HTML and CSS have to be such a back and forth between designers and devs? Why is it that the rest of the stack can have TDD and BDD but not the presentation layer? Well, GreenOnion is here to help you get the same results on testing front-end styling that you've enjoyed in your unit and integration tests up to now.
GreenOnion records 'skins', which are snapshots of the current state of a view (or any page that a browser can navigate to). The first time that it is run on a view…
I was experiencing the following problem:
It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby
So I tried to install the libyaml package via:
rvm pkg install libyaml
This is when I experienced the SSL certification problem mentioned above. This happens when your RVM certificates have expired. You can fix this by updating them via:
rvm get stable
After doing that curl could verify the SSL certificate and I w…
So your Cucumber feature sometimes dies with this exception:
Modal Dialog Present (Selenium::WebDriver::Error::UnhandledAlertError)
As a seasoned Selenium vetaran you are used to misleading error messages. Hence you might be surprised that the reason for this particular error is that there is actually a modal dialog present and preventing Selenium from executing commands like
The reason why a dialog is shown is somewhat fucked …
For string columns, MySQL indexes the left side of a string. That means an index can speed a like query that has a wildcard on the right side:
SELECT * FROM foo WHERE field LIKE "bar%" # will be faster with an index
It can not speed up a query that has a variable left side:
SELECT * FROM foo WHERE field LIKE "%bar%" # will not be faster with an index
That also means if you use the ancestry gem you should index your
ancestry column if you use scopes like
descendants or `su…
Be careful when stubbing out attributes on records that are defined by associations. Nothing is as it seems to be.
The associated record has its own universe of things; when delegating calls to it, you ca not stub methods on the associated record and expect them to be around. That is a general issue with this pattern/approach.
Consider these classes:
class Post < ActiveRecord::Base belongs_to :thread def thread_title thread.title end end class Thread < Acti...
It might be one of the following:
application.css) which is always empty during development
ReText is a cross-platform WYSIWYG-ish Markdown editor.
Toggle editor and preview layout with
Ctrl+L to split the window for a live preview.
I use it to copy Pivotal Tracker story descriptions over, switch to the preview and have it as a small always-on-top window in a corner of one of my screens.
On Ubuntu, you can use a PPA to install:
sudo add-apt-repository ppa:mitya57/ppa sudo apt-get update sudo apt-get install retext
If you encounter a Firefox that does not care about your font settings but always uses specific fonts, you can fix that. Usually this should not happen, as it's not a default setting:
How delayed jobs can make your
after_save callbacks execute before the record is saved.
You can quickly access views that belong to a controller by using the tiny "page with arrow" icon in the gutter:
Click the icon next to the method definition in the controller.
If a view file does not yet exist, RubyMine will prompt you for its filename.
For a list of all views and partials that belong to the current …
I recently worked on a project with 60+ old feature branches. Most of them had been merged into master and were subsequently abandoned. We decided we wanted to clean up a bit, and git made that easy.
This Firebug feature is called simply Log Events and allows developers to log DOM events into the Console panel.
All you need to do is right click on an element in the HTML panel, pick Log Events from the context menu and switch to the Console panel to see the logs in action.
Explanation of the "bootstrap 2" base CSS.
Contains information about: