Created
March 29, 2011 19:09
-
-
Save dhh/893027 to your computer and use it in GitHub Desktop.
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
describe "GET current" do | |
before do | |
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
get :current, :format => 'js' | |
end | |
it { should respond_with(:success) } | |
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") } | |
it { should render_template('notices/current') } | |
end | |
end | |
# vs | |
test "GET current (or preferably an explanation WHY we are testing it)" do | |
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
get :current, :format => 'js' | |
assert respond_with(:success) | |
assert_equal "#{notices(:permanent).id}", cookies[:hidden_notices] | |
assert_template 'notices/current' | |
end |
I can't take a design opinion seriously from the person who built rails.
Plus all the things that other people have pointed out about these examples being no way near equivalent.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jrwest there is no need for the
r
variable.But in the end still it comes down to taste.