サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ノーベル賞
everydayrails.com
Replacing RSpec controller tests, part 3: Removing business logic from controllers After the Rails core team announced major changes to controller-level testing upon the release of Rails 5.0, I wrote a couple of pieces in Everyday Rails about how to shift testing responsibility up, to either request specs, or browser-based feature specs (or system specs, in the current Rails testing landscape). Ho
Replacing RSpec controller specs, part 1: Request specs Action Cable may be the new Rails 5 feature that got the most attention, but what caught my eye from this release was a big change to controller-level testing. While controller tests themselves haven’t been removed in Rails 5, a couple of commonly-used helpers, assigns and assert_template, have been deprecated. These helpers lead to brittle t
How I learned to test my Rails applications, Part 4: Controller specs Controller testing has been soft-deprecated in Rails, but you're still likely to see controller specs in many Rails codebases. The basics covered in this post still apply. Be sure to read my posts on replacing controller specs with feature specs and request specs for an up-to-date take on testing your code. Thanks! Poor controll
How I learned to test my Rails applications, Part 3: Model specs We’ve got all the tools we need for building a solid, reliable test suite—now it’s time to put them to work. We’ll get started with the app’s core building blocks—its models. In this post, we’ll complete the following tasks: First we’ll create a model spec for an existing model—in our case, the actual Contact model. Next, we’ll simpl
Rails 3 has been out for a few months now, and one of the many changes was an update to the API for generators and templates. If you’re not familiar, you’ll now use the Thor utility for these purposes, and overall the process is much more modular and customizable. Here’s how to get started. Why would you want to use an application template, given how customizable and modular Rails 3 is? Exactly fo
Mobile web frameworks are taking off, and developers now have a number of options for making great-looking mobile-optimized web applications with relative ease. In the past I covered jQTouch, a jQuery-based JavaScript framework (see part one and part two of my work), but ran into frustrations when trying to integrate it with the likes of Devise. Meanwhile, jQuery Mobile, from the jQuery Group them
If you’ve been using Reek to help in refactoring your Rails applications, you might run across warnings of Irresponsible Modules— that is, code with no comments to help explain what it does. A common knock on the Rails community is that we don’t document our code. I hate to admit it, but it’s fair. My own Rails project folders are full of uncommented methods and mysterious model attributes. If I c
Refactoring—the practice of making your working code better and more manageable through better design choices—is an important part of software development. It’s core to test-driven and behavior-driven methods, but if you’re not yet following the red-green-recycle mantra in your development, you may have yet to experience refactoring in practice. There are plenty of resources on refactoring; today
Sorry about the delay in posting—everyday life got in the way of Everyday Rails. I’ve also been in the middle of changing how my development Ruby environment works, and want to share that today. In a little more than a year, RVM (Ruby Version Manager) has become a critical tool for Ruby and Rails developers. A few months ago, when Rails 3 was still in beta, I wrote how to use RVM’s gemsets feature
Mobile Rails applications, part 2: jQTouch with Rails 3 In my last post I shared my first steps toward creating a mobile version of a Rails application. I looked at the Mobile Fu plugin, but wasn’t happy with how it played with other parts what you might want to do with a Rails application. So referring to a couple of screencasts I moved forward with hand-rolling my mobile detection code—as it tur
Out of the box, Rails’ date_select input type and other date/time-related times are a bit ugly and not very user-friendly—just a series of pulldown menus from which to select the month, day, year, hour, minute, and so on. You can pretty these up using a number of calendar-related plugins, notably by using Javascript, but there’s another way you can make date and time more user-friendly. I like goi
If you’re just getting into Ruby or Rails now, and looking for some light reading, you’re in luck. Publishers like the Pragmatic Programmers, O’Reilly, Manning Publications, and others have tons of books available to help you learn. You could easily spend a few hundred dollars building a bookshelf of Ruby references. There are also some good free books to peruse online (or download) to get started
Building Rails apps faster with Nifty Generators, part 2: nifty_config Continuing with my series on the Nifty Generators gem by Ryan Bates (see part 1 on nifty_layout), in this post I want to talk about a second feature this gem provides, called nifty_config. With nifty_config, you can quickly create a set of global variables for your application, dependent on the environment in which your Rails a
Building Rails apps faster with Nifty Generators, part 1: nifty_layout Moving along with the steps I follow to create a new Rails application, I want to get into a little detail on some of the specific steps I outlined previously. These are the first steps in taking a Rails app beyond the default shell and making it do what you need to get done. While most of the steps I went through last week are
Since Thoughtbot released it a couple of years ago, Paperclip has practically become synonymous with file upload for many Rails developers. Out of the box, Paperclip saves uploaded files in your application’s public directory, which makes good sense for files that should be accessible to everyone—by storing them there, you can serve them without the additional overhead of Rails. But what if you do
Testing with RSpec book updates for July 2024 Finally, here's the first release of my RSpec testing book, updated for the latest Rails stack! (July 21, 2024) Replacing system tests with unit tests Is your testing strategy too top-heavy? Here are some techniques to spread coverage down the testing pyramid. (June 01, 2024)
このページを最初にブックマークしてみませんか?
『Everyday Rails』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く