This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
gem 'mysql2' | |
gem "rspec-rails", '2.0.0.beta.22' | |
gem "rspec", '2.0.0.beta.22' | |
gem 'capybara', '0.3.9' | |
gem 'database_cleaner', '0.5.2' | |
gem 'cucumber-rails', '0.3.2' | |
gem 'cucumber', '0.9.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppBuilder < Rails::AppBuilder | |
include Thor::Actions | |
include Thor::Shell | |
def test | |
append_test_gems | |
rspec | |
cucumber | |
jasmine | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A benefit of test driving Rails applications, especially underlying | |
model behaviors, is the documentation that results from test driving. | |
When I want to quickly ramp up on a new Gem, I always look at the | |
test suite for insight into how the Gem or subsystem works. | |
I've been diving into (http://cukes.info/, "Cucumber") recently | |
and have been a long time user of (http://fitnesse.org/ "FitNesse"), | |
although with Cucumber I've recently watched developers opt to not | |
write unit tests and replace their test suite entirely with Cucumber features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recently there has been a lot of discussion around project dependencies. As a result, | |
it has been pretty hard to decide when and if to include a new gem into a | |
project. | |
Overall, I think I tend to weigh in heavier on the side of exclude everything possible | |
except what is absolutely necessary. That being said, here's the mental check list I | |
tend to work through when deciding whether or not to include a dependency. | |
Is it something that I really need? Is it something that I can write myself? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ever wondered how to login as another user within Devise? | |
Recently we had a feature request that would provide Admins with the ability | |
to sign is as another user. You could imagine live demonstrations or even production | |
support calls where you would like to be signed in as another user, yet not | |
have to ask for or decrypt their current password. After stewing for a bit, we found a | |
pretty nice solution with Devise. | |
Here's the Cucumber feature... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wouldn't it then be nice to include the resque-web interface underneath your current application's url. | |
Wouldn't it be nice to use the same authentication mechanism that your web application uses? | |
Here's a solution that we used on a recent Rails 2.3 ey-cloud project that accomplished both goals. | |
First, we created a simple resque_web.ru file within our Rails 2.3 project. In this example we used the same Warden SSO authentication mechanism and fired up the resque-web server from the new mapping. | |
<pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We're using Devise's token_authenticatable to improve Cucumber test suite performance. | |
Here's an example feature | |
Scenario: I would like to edit a user account | |
Given I am logged in as an admin user | |
... | |
And here's the step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's a quick snippet that we're using to reindex Solr from our Cucumber features. | |
"And I reindex assets" helps to ensure that we didn't leave any cruft around from previous | |
tests and that we've properly indexed our Pickle model. | |
Background: | |
And I am logged in as an admin user | |
And an asset with snowboarding tags: "snowboarding" exists with title: "Snowboarding", alt_text: "Snowboarding", summary: "A summary about snowboards" | |
And I reindex assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you've recently forked the ey-cloud-recipes on GitHub and then had issues | |
managing and deploying multiple projects with disparate dependencies using the | |
single forked gem, then we have a solution that has worked well on a recent project. | |
We've tucked the cookbooks directory underneath our Rails project. To apply Chef | |
changes, we installed the 'engineyard' gem and us 'ey recipes upload' and | |
'ey recipes apply' from within our Rails project. | |
Upside, everything you need to know about the project is local to the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LOAD_PATH << File.join(File.dirname(__FILE__), "../vendor/redis-rb/lib") | |
autoload :Redis, "redis" |