Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PostTest running. added Post.recent.
- Loading branch information
Showing
12 changed files
with
74 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class User < ActiveRecord::Base | ||
acts_as_authentic | ||
#acts_as_authentic | ||
end |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
We have <%= Post.count %> total posts, isn't that great? During the past days, we blogged about the following bullshit: | ||
|
||
<% for post in @posts %> | ||
<h2><%= link_to post, post %></h2> | ||
|
||
<%= post.text %> | ||
<% end %> | ||
<% end %> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
title: Post one | ||
text: This is post number one, great! | ||
created_at: 2010-11-08 | ||
id: 1 | ||
|
||
two: | ||
title: Post two | ||
text: This is post number 2, great! | ||
created_at: 2010-11-09 | ||
id: 2 | ||
|
||
three: | ||
title: Post 3 | ||
text: This is post number 3, great! | ||
created_at: 2010-11-10 | ||
id: 3 | ||
|
||
four: | ||
title: Post 4 | ||
text: This is post number 4, great! | ||
created_at: 2010-11-11 | ||
id: 4 | ||
|
||
five: | ||
title: Post 5 | ||
text: This is post number 5, great! | ||
created_at: 2010-11-12 | ||
id: 5 | ||
|
||
six: | ||
title: Post 6 | ||
text: This is post number 6, great! | ||
created_at: 2010-11-13 | ||
id: 6 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
username: MyString | ||
crypted_password: MyString | ||
|
||
two: | ||
username: MyString | ||
crypted_password: MyString |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'test_helper' | ||
|
||
class PostTest < ActiveSupport::TestCase | ||
test "should respond to .recent" do | ||
assert_equal [6, 5, 4, 3, 2], Post.recent.collect { |p| p.id } | ||
end | ||
end |