Skip to content

Commit

Permalink
Added test.
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticleo committed Dec 28, 2015
1 parent e86aa09 commit 4569cdf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test_parse_resource.rb
Expand Up @@ -120,11 +120,20 @@ def test_first
end
end

def test_find_by_attribute
VCR.use_cassette('test_find_by_attribute', :record => :new_episodes) do
p1 = Post.create(:title => "Welcome111")
where = Post.where(:title => "Welcome111").first
find = Post.find_by_title("Welcome111")
assert_equal where.id, find.id
end
end

def test_find_by
VCR.use_cassette('test_find_by', :record => :new_episodes) do
p1 = Post.create(:title => "Welcome111")
where = Post.where(:title => "Welcome111").first
find = Post.find_by_title("Welcome111")
find = Post.find_by(:title => "Welcome111")
assert_equal where.id, find.id
end
end
Expand Down

0 comments on commit 4569cdf

Please sign in to comment.