2
votes
1answer
246 views

How do I DRY this code?

I have two main problems with a chunk of code. I need to interpolate 2 different models in a specific order in a list. In the world of casinos, there are different types of games and jackpots. In ...
16
votes
4answers
8k views

How to effectively unit test a controller in Ruby on Rails?

I intend this to be a general question on writing an effective set of test cases for a controller action. I include the following ingredients: Ruby on Rails RSpec: A testing framework. I considered ...
2
votes
2answers
73 views

Transfer the format of an old string to a new string

First, I've extended the String class to detect uppercase and lowercase characters: ...