Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.
Website Hosting
Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.
Website Hosting
I took the ideas presented here and built a gem called Mustard. Check it out!
There are several expectation/assertion interfaces available for writing tests/specs. Here are some issues I have with them.
assert_equals
feels backwardsassert_equal
(that too)This example is not my real app, but it's modeled pretty closely to it.
My mom schedules a couple hundred employees at a local warehouse. In their system, a worker can earn "points" for being late or missing shifts. Here we have a sort of summary screen for my mom, who may need to follow up with new employees or discipline employees with concerning levels of points.
Questions that arise as I code something like this:
# COMMUNITY CHALLENGE | |
# | |
# How would you test this Quiz#problem method? Only two rules: | |
# | |
# 1. The tests should fail if any part of the application breaks. | |
# For example: If "gets" is moved before "puts" then the tests should | |
# fail since that breaks the application. | |
# | |
# 2. You cannot change the Quiz class. But you can use whatever framework | |
# and tools you want for the tests. (RSpec, Cucumber, etc.) |
001-caching-with-instance-variables | |
002-dynamic-find-by-methods | |
003-find-through-association | |
004-move-find-into-model | |
005-using-with-scope | |
006-shortcut-blocks-with-symbol-to-proc | |
007-all-about-layouts | |
008-layouts-and-content-for | |
009-filtering-sensitive-logs | |
010-refactoring-user-name-part-1 |
class TasksController < ApplicationController | |
def update | |
tracker = TaskTracker.new(@task) | |
if @task.update_attributes(params[:task]) | |
TaskPusher.new(tracker, socket_id).push_changes | |
TaskMailSender.new(tracker, current_user).deliver_email | |
# success response | |
else | |
# failure respond | |
end |
cd ~/code/rails | |
railties/bin/rails new ~/code/hello --edge | |
cd ~/code/hello | |
echo "gem 'puma'" >> Gemfile | |
bundle | |
rails g controller hello index | |
# fill controller | |
puma | |
# separate tab | |
curl localhost:9292/hello/index |
# add this to your spec helper | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.filter_run :focus => true | |
config.run_all_when_everything_filtered = true | |
end | |
# and then use the :focus tag in your specs | |
it "does something awesome", :focus do |
# Add this to your spec_helper.rb | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/") | |
VCR.use_cassette(name, :record => :new_episodes) do | |
example.call | |
end | |
end | |
end |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>RailsCasts</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |