Alternative to turn gem for rails MiniTest - ruby-on-rails

I've recently upgraded to Rails 4.2.0 and MiniTest ~> 5, and that broke the Turn gem. I noticed that it is no longer being maintained due to the developers getting fed up with API changes https://github.com/turn-project/turn , so I pulled it out of my project.
I'm really missing the better test output that Turn provided. What are some great alternatives to get customizable, colorized, well-structured MiniTest output?

Take a look at minitap and tapout - it's not a simple plug-and-play gem like turn was, but you can get it very nice with a bit of trial and error.

Related

How to make cucumber-rails use watir-webdriver instead of Capybara

I have been searching for a simple answer to this for a few days and can't seem to find an one, on either stackoverflow.com or google. So, firstly, if this is answered elsewhere please point me in the correct direction.
So, I have a relatively new Rails 3 project using the cucumber-rails gem. I am relatively new to Rails but have experience in Ruby and other web frameworks such as Sinatra and Ramaze. My understanding is that out of the box, cucumber-rails uses Capybara for interacting with the web application and somehow does this without starting the rails server. It somehow interacts with rack to simulate the requests. Not sure if I have that entirely correct but I'm pretty sure it does not need a running rails server.
I am not a great fan of the Capybara DSL and I much prefer watir-webdriver which I have used in a few non rails projects (and non Ruby projects even). However, I have not been able to find anywhere to show me how to swap out Capybara for watir-webdriver.
So my questions are these:
Does the cucumber-rails gem have the ability to swap Capybara out for watir-webdriver?
If so, what is the best way to do this?
If not, does that mean I need to ditch cucumber-rails and just set cucumber with watir-webdriver up in my project manually?
Well, it doesn't look hopeful from the project description:
Rails Generators for Cucumber with special support for Capybara and DatabaseCleaner
And sure enough, it explicitly, unconditionally, loads Capybara here
I think that means that you're going to need to hook it up yourself.
Having said that, I don't think there's anything stopping you from installing the gem, running rails g cucumber:install, and then replacing the Capybara-specific bits in the files it produces.

Load Rails 3 test fixtures into development database

I have a nice set of fixtures that I use for testing. When a request test fails it is handy to run the app interactively with the test fixtures loaded. But if I run the full server with -e test I get all kinds of crazy errors, probably having to do with the pipeline.
-- edit --
When I visit the home page I get this in the browser:
I say it's crazy, because I don't understand it :) In particular, I am using twitter-bootstrap and I am unclear about sass/scss/css work with Twitter Bootstrap + Rails so it's highly likely that I have some detail wrong in how I am using them together (or that the gem twitter-bootstrap-rails has some bug.)
Ah, much better question :-).
The twitter-bootstrap-rails gem uses LESS, which is similar to SASS in what it does, but not the same. SASS is the default for Rails, and a good choice. If you want to use SASS, (and based on the error, it appears you are), then use the Bootstrap SASS gem instead, linked here. It may be possible to use both LESS and SASS together, but that seems like a Bad Idea to me.
Check out Ryan Bates' excellent RailsCast which covers using Twitter Bootstrap in Rails. It covers both alternatives. And then fork over the $9 to get Pro access to his continued RailsCast with more details.

Is it possible to use nokogiri in rhodes framework?

I want to use nokogiri for my rhodes mobile application. I got an error like
Error: no such file to load --nokogiri.
How can i use nokogiri in rhodes ?
I would imagine (though I haven't used Rhodes properly myself) that due to the way it is written, gems that include C extensions, like Nokogiri, would not work on Rhodes.
Rhodes apparently includes both the Ruby standard ReXML as well as a lightweight implementation called RhoXML. I did find this link that might help: http://wiki.rhomobile.com/index.php/RhodesExtensions#XML_handling.
I went through the full exercise of trying to use nokogiri when I found a bug in REXML that I didn't want to use the workaround for. I was unsuccessful in adding the library. (I got it to the point where it would load, but every single parsed document returned nil.)
According to the developers who watch http://groups.google.com/group/rhomobile , they do not support nokogiri on the device -- only on the RhoSync platform.

Tracking down and fixing i18n deprecation warnings in rails 3 (cucumber 0.9.3 to blame?)

My cucumber test passes, but leaves this ridiculous stack trace. Just your basic The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead. error message, but how am I to find the culprit in that list?
I never used the {{key}} syntax myself, so some gem I'm using is outdated. Please tell me which one. It's really frustrating to have so much kruft every time I run a test.
I was getting that error with Authlogic and it turned out that the more recent versions of the I18n gem (0.4.x, I think) deprecated the call.
I avoided the problem by "rolling back" my I18n gem to version 0.3.7.
As to which plugin, at a guess this is the key line (line 15 on your gist):
/Library/Ruby/Gems/1.8/gems/responders-0.6.0/lib/responders/flash_responder.rb:115:in `set_flash_message!
Since it is the first one that is after the I18n lines, I suspect it is the one that is calling translate with the deprecated interpolation.
(Update a few minutes later):
Looking at: http://github.com/plataformatec/responders/commits/master, ...it looks like you could just upgrade to responders 0.6.2. Their commit on June 24th seems to address the issue.

Getting started with rails? Must have gems?

I'm starting work on a project using Rails, but I'm waiting for the 3rd edition of the pragmatic rails book to come out before I purchase a book.
Anyway, my question is a bit more pointed than how do I get started...
What are some of the must have gems that everyone uses?
I need basic authentication, so I have the restful authentication gem, but beyond that, I don't know what I don't know. Is there a run down of this information somewhere? Some basic setup that 99% of the people start with when starting a new rails application?
Thanks in advance.
The gems and plugins that I tend to use on most of my projects are:
Restful Authentication -- For authentication
Will Paginate -- For pagination
Attachment Fu -- For image and file attachments
RedCloth -- For textile rendering
Capistrano -- For deployment
For pagination, will_paginate.
This is very, very subjective because it all depends on what your application does! However, I've just had a look at the Gems I have installed and the one that absolutely does leap out as mandatory is Capistrano.
BTW Restful Authentication is a Rails plugin not a Gem.
HAML is a must have. You'll never think of HTML in the same way again -- No more tag soup.
sudo gem install haml
sudo gem install ZenTest
rspec on rails
How can nobody have mentioned andand yet? It's the best thing since ||=
The only gems you need are:
Rails
Rake
If you "gem install rails" you'll get everything you need for Rails. You only need gems when you need them, so it's not worth worrying about before then.
EDIT: Actually there are a couple more you'll probably need:
mysql - or whatever Ruby database driver you need
mongrel - you don't necessarily need this until production, but it's nice to use in dev/test too
ZenTest - I use this mainly for "autotest" so that my tests run in a console window whenever my source files change
There could be many other gems that help you but we'd need more info from you to know if they're applicable, eg:
Web scraping (hpricot)
CSV (fastercsv)
Amazon S3 support (aws-s3)
Image manipulation (rmagick)
Graphing (gruff) - I use this as a plugin
Role-based security (role_requirement) - This one is a plugin too
mini_magick instead of rmagick.
Might want to keep an eye on: http://rubygems.org/ - you can see some interesting stats there re: most downloaded, most active, etc...
Also interesting and somewhat telling: https://github.com/languages/Ruby
This is a old thread but I thought I'll refine the list with what I believe to be must have gems at this point in time:
RSpec or Shoulda - tools for BDD/testing
factory_girl - fixture replacement
will_paginate - simple pagination
paperclip - image uploading/attachment
CanCan - authorization
Authlogic - authentication
HAML - templating engine

Resources