summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2013-05-31 22:26:22 +0200
committerjomo <github@jomo.tv>2013-05-31 22:26:22 +0200
commit8921d108e238b12fab71cb4834a3020f592b75ae (patch)
tree4c2f359687506ae8b4688ad38399bf9ce2d52a99 /test
parent149232ec0cb112901648196ec341066bd88ee6be (diff)
first release
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/blogposts.yml11
-rw-r--r--test/fixtures/comments.yml11
-rw-r--r--test/fixtures/users.yml11
-rw-r--r--test/functional/blogposts_controller_test.rb49
-rw-r--r--test/functional/comments_controller_test.rb49
-rw-r--r--test/functional/users_controller_test.rb49
-rw-r--r--test/unit/blogpost_test.rb7
-rw-r--r--test/unit/comment_test.rb7
-rw-r--r--test/unit/helpers/blogposts_helper_test.rb4
-rw-r--r--test/unit/helpers/comments_helper_test.rb4
-rw-r--r--test/unit/helpers/users_helper_test.rb4
-rw-r--r--test/unit/user_test.rb7
12 files changed, 213 insertions, 0 deletions
diff --git a/test/fixtures/blogposts.yml b/test/fixtures/blogposts.yml
new file mode 100644
index 0000000..c63aac0
--- /dev/null
+++ b/test/fixtures/blogposts.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml
new file mode 100644
index 0000000..c63aac0
--- /dev/null
+++ b/test/fixtures/comments.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
new file mode 100644
index 0000000..c63aac0
--- /dev/null
+++ b/test/fixtures/users.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/functional/blogposts_controller_test.rb b/test/functional/blogposts_controller_test.rb
new file mode 100644
index 0000000..831efa2
--- /dev/null
+++ b/test/functional/blogposts_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class BlogpostsControllerTest < ActionController::TestCase
+ setup do
+ @blogpost = blogposts(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:blogposts)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create blogpost" do
+ assert_difference('Blogpost.count') do
+ post :create, blogpost: { }
+ end
+
+ assert_redirected_to blogpost_path(assigns(:blogpost))
+ end
+
+ test "should show blogpost" do
+ get :show, id: @blogpost
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @blogpost
+ assert_response :success
+ end
+
+ test "should update blogpost" do
+ put :update, id: @blogpost, blogpost: { }
+ assert_redirected_to blogpost_path(assigns(:blogpost))
+ end
+
+ test "should destroy blogpost" do
+ assert_difference('Blogpost.count', -1) do
+ delete :destroy, id: @blogpost
+ end
+
+ assert_redirected_to blogposts_path
+ end
+end
diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb
new file mode 100644
index 0000000..3ae3778
--- /dev/null
+++ b/test/functional/comments_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class CommentsControllerTest < ActionController::TestCase
+ setup do
+ @comment = comments(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:comments)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create comment" do
+ assert_difference('Comment.count') do
+ post :create, comment: { }
+ end
+
+ assert_redirected_to comment_path(assigns(:comment))
+ end
+
+ test "should show comment" do
+ get :show, id: @comment
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @comment
+ assert_response :success
+ end
+
+ test "should update comment" do
+ put :update, id: @comment, comment: { }
+ assert_redirected_to comment_path(assigns(:comment))
+ end
+
+ test "should destroy comment" do
+ assert_difference('Comment.count', -1) do
+ delete :destroy, id: @comment
+ end
+
+ assert_redirected_to comments_path
+ end
+end
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
new file mode 100644
index 0000000..f035272
--- /dev/null
+++ b/test/functional/users_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ setup do
+ @user = users(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:users)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create user" do
+ assert_difference('User.count') do
+ post :create, user: { }
+ end
+
+ assert_redirected_to user_path(assigns(:user))
+ end
+
+ test "should show user" do
+ get :show, id: @user
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @user
+ assert_response :success
+ end
+
+ test "should update user" do
+ put :update, id: @user, user: { }
+ assert_redirected_to user_path(assigns(:user))
+ end
+
+ test "should destroy user" do
+ assert_difference('User.count', -1) do
+ delete :destroy, id: @user
+ end
+
+ assert_redirected_to users_path
+ end
+end
diff --git a/test/unit/blogpost_test.rb b/test/unit/blogpost_test.rb
new file mode 100644
index 0000000..f732697
--- /dev/null
+++ b/test/unit/blogpost_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class BlogpostTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb
new file mode 100644
index 0000000..b6d6131
--- /dev/null
+++ b/test/unit/comment_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class CommentTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/helpers/blogposts_helper_test.rb b/test/unit/helpers/blogposts_helper_test.rb
new file mode 100644
index 0000000..7418751
--- /dev/null
+++ b/test/unit/helpers/blogposts_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class BlogpostsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb
new file mode 100644
index 0000000..2518c16
--- /dev/null
+++ b/test/unit/helpers/comments_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class CommentsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/users_helper_test.rb b/test/unit/helpers/users_helper_test.rb
new file mode 100644
index 0000000..96af37a
--- /dev/null
+++ b/test/unit/helpers/users_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UsersHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
new file mode 100644
index 0000000..82f61e0
--- /dev/null
+++ b/test/unit/user_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UserTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end