Changeset 1620
- Timestamp:
- 01/10/08 03:20:58 (4 months ago)
- Files:
-
- trunk/test/fixtures/articles_tags.yml (deleted)
- trunk/test/fixtures/blacklist_patterns.yml (modified) (1 diff)
- trunk/test/fixtures/categories.yml (modified) (6 diffs)
- trunk/test/fixtures/categorizations.yml (modified) (1 diff)
- trunk/test/fixtures/contents.yml (modified) (13 diffs)
- trunk/test/fixtures/feedback.yml (modified) (10 diffs)
- trunk/test/fixtures/resources.yml (modified) (3 diffs)
- trunk/test/fixtures/tags.yml (modified) (1 diff)
- trunk/test/functional/accounts_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/article_preview_test.rb (modified) (1 diff)
- trunk/test/functional/admin/blacklist_controller_test.rb (modified) (3 diffs)
- trunk/test/functional/admin/categories_controller_test.rb (modified) (4 diffs)
- trunk/test/functional/admin/comments_controller_test.rb (modified) (8 diffs)
- trunk/test/functional/admin/content_controller_test.rb (modified) (12 diffs)
- trunk/test/functional/admin/feedback_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/pages_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/resources_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/settings_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/textfilters_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/themes_controller_test.rb (modified) (1 diff)
- trunk/test/functional/admin/trackbacks_controller_test.rb (modified) (8 diffs)
- trunk/test/functional/admin/users_controller_test.rb (modified) (1 diff)
- trunk/test/functional/articles_controller_test.rb (modified) (6 diffs)
- trunk/test/functional/backend_controller_test.rb (modified) (11 diffs)
- trunk/test/functional/redirect_controller_test.rb (modified) (1 diff)
- trunk/test/functional/textfilter_controller_test.rb (modified) (1 diff)
- trunk/test/functional/xml_controller_test.rb (modified) (4 diffs)
- trunk/test/test_helper.rb (modified) (1 diff)
- trunk/test/unit/amazon_sidebar_test.rb (modified) (1 diff)
- trunk/test/unit/article_closing_test.rb (modified) (1 diff)
- trunk/test/unit/article_test.rb (modified) (5 diffs)
- trunk/test/unit/blacklist_pattern_test.rb (modified) (1 diff)
- trunk/test/unit/blog_test.rb (modified) (1 diff)
- trunk/test/unit/cache_support_test.rb (modified) (1 diff)
- trunk/test/unit/category_test.rb (modified) (2 diffs)
- trunk/test/unit/comment_test.rb (modified) (4 diffs)
- trunk/test/unit/configuration_test.rb (modified) (1 diff)
- trunk/test/unit/content_state/feedback_states_test.rb (modified) (1 diff)
- trunk/test/unit/notification_mailer_test.rb (modified) (1 diff)
- trunk/test/unit/notification_test.rb (modified) (1 diff)
- trunk/test/unit/page_test.rb (modified) (2 diffs)
- trunk/test/unit/ping_test.rb (modified) (1 diff)
- trunk/test/unit/redirect_test.rb (modified) (1 diff)
- trunk/test/unit/resource_test.rb (modified) (1 diff)
- trunk/test/unit/sidebar_test.rb (modified) (1 diff)
- trunk/test/unit/tag_test.rb (modified) (4 diffs)
- trunk/test/unit/text_filter_test.rb (modified) (1 diff)
- trunk/test/unit/theme_test.rb (modified) (1 diff)
- trunk/test/unit/trackback_test.rb (modified) (1 diff)
- trunk/test/unit/trigger_test.rb (modified) (1 diff)
- trunk/test/unit/user_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/fixtures/blacklist_patterns.yml
r178 r1620 1 1 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 2 first_blacklist_pattern: 3 id: 14 3 type: StringPattern 5 4 pattern: poker 6 5 7 6 another_blacklist_pattern: 8 id: 29 7 type: RegexPattern 10 8 pattern: ^Texas trunk/test/fixtures/categories.yml
r1031 r1620 1 1 software: 2 id: 13 2 name: Software 4 3 permalink: software … … 6 5 7 6 hardware: 8 id: 29 7 name: Hardware 10 8 permalink: hardware … … 12 10 13 11 personal: 14 id: 315 12 name: Personal 16 13 permalink: personal … … 18 15 19 16 lifeonmars: 20 id: 421 17 name: Life On Mars 22 18 permalink: life-on-mars … … 24 20 25 21 strangelynamed: 26 id: 527 22 name: "The Permalink doesn't match" 28 23 permalink: weird-permalink … … 30 25 31 26 xmltest: 32 id: 633 27 name: "this & that" 34 28 permalink: this-and-that trunk/test/fixtures/categorizations.yml
r1300 r1620 1 1 articles_categories1: 2 article _id:13 category _id: 12 article: article1 3 category: software 4 4 5 5 articles_categories2: 6 article _id:17 category _id: 26 article: article1 7 category: hardware 8 8 9 9 articles_categories3: 10 article _id:111 category _id: 310 article: article1 11 category: personal 12 12 13 13 articles_categories4: 14 article _id: 215 category _id: 314 article: article2 15 category: personal 16 16 17 17 articles_categories5: 18 article _id:319 category _id: 320 18 article: article3 19 category: personal 20 21 21 articles_categories6: 22 article _id:423 category _id: 322 article: article4 23 category: personal 24 24 25 25 articles_categories7: 26 article _id:127 category _id: 526 article: article1 27 category: strangelynamed 28 28 29 29 articles_categories8: 30 article _id: 1831 category _id: 630 article: xmltest 31 category: xmltest trunk/test/fixtures/contents.yml
r1480 r1620 3 3 article1: 4 4 blog_id: 1 5 id: 16 5 title: Article 1! 7 6 body: body … … 19 18 published: true 20 19 state: published 20 tags: foo, bar 21 21 22 22 article2: 23 23 type: Article 24 24 blog_id: 1 25 id: 226 25 title: Article 2! 27 26 body: body … … 38 37 published: true 39 38 state: published 39 tags: foo 40 40 41 41 … … 43 43 type: Article 44 44 blog_id: 1 45 id: 346 45 title: Article 3! 47 46 body: body … … 62 61 type: Article 63 62 blog_id: 1 64 id: 465 63 title: Article 4! 66 64 body: I'm not "public":http://www.example.com/public! … … 76 74 author: Tobi 77 75 guid: ddddd 76 tags: bar, bazz 78 77 79 78 first_page: 80 79 type: Page 81 80 blog_id: 1 82 id: 983 81 name: page_one 84 82 title: Page One Title … … 94 92 type: Page 95 93 blog_id: 1 96 id: 1097 94 name: page/two 98 95 title: Another Page Title … … 108 105 type: Page 109 106 blog_id: 1 110 id: 11111 107 name: markdown-page 112 108 title: Markdown Page … … 123 119 type: Article 124 120 blog_id: 1 125 id: 14126 121 title: Inactive Article 127 122 body: body … … 142 137 type: Article 143 138 blog_id: 2 144 id: 16145 139 title: Second Blog Article 146 140 body: body … … 161 155 type: Article 162 156 blog_id: 1 163 id: 17164 157 title: Find me! 165 158 body: search target … … 180 173 type: Article 181 174 blog_id: 1 182 id: 18183 175 title: Associations aren't :dependent => true anymore 184 176 body: originally seen on <a href="http://blog.rubyonrails.org/">blog.rubyonrails.org</a> … … 199 191 type: Article 200 192 blog_id: 1 201 id: 19202 193 title: C'mon Spam Me! 203 194 body: A bunch of innocuous content trunk/test/fixtures/feedback.yml
r1438 r1620 2 2 type: Comment 3 3 blog_id: 1 4 id: 15 4 published: true 6 article _id:25 article: article2 7 6 author: Bob Foo 8 7 url: http://fakeurl.com … … 17 16 type: Comment 18 17 blog_id: 1 19 id: 220 18 published: true 21 article _id:119 article: article1 22 20 author: John Bar 23 21 user_id: 2 … … 34 32 type: Comment 35 33 blog_id: 1 36 id: 337 34 published: false 38 35 state: presumed_spam 39 36 status_confirmed: false 40 article _id:137 article: article1 41 38 author: Foo Bar 42 39 body: Zzzzzz … … 49 46 type: Trackback 50 47 blog_id: 1 51 id: 4 52 article_id: 2 48 article: article2 53 49 published: false 54 50 state: presumed_spam … … 66 62 type: Trackback 67 63 blog_id: 1 68 id: 5 69 article_id: 1 64 article: article1 70 65 state: presumed_ham 71 66 published: true … … 82 77 type: Trackback 83 78 blog_id: 1 84 id: 6 85 article_id: 1 79 article: article1 86 80 published: true 87 81 state: presumed_ham … … 98 92 type: Trackback 99 93 blog_id: 1 100 id: 7 101 article_id: 17 94 article: search_target 102 95 published: true 103 96 state: presumed_ham … … 114 107 type: Comment 115 108 blog_id: 1 116 id: 8 117 article_id: 14 109 article: inactive_article 118 110 author: John Bar 119 111 guid: b1i2n3g4o5t6i7v … … 130 122 type: Comment 131 123 blog_id: 1 132 id: 9133 124 published: false 134 article _id: 19125 article: spammed_article 135 126 author: Bob Foo 136 127 url: http://fakeurl.com … … 146 137 type: Comment 147 138 blog_id: 1 148 id: 10149 139 published: false 150 article _id: 19140 article: spammed_article 151 141 author: Bob Foo 152 142 url: http://fakeurl.com trunk/test/fixtures/resources.yml
r1031 r1620 2 2 resource1: 3 3 id: 1 4 article _id:14 article: article1 5 5 filename: me.jpg 6 6 mime: 'image/jpeg' … … 10 10 resource2: 11 11 id: 2 12 article _id:112 article: article1 13 13 filename: moi 14 14 mime: 'image/jpeg' … … 18 18 resource3: 19 19 id: 3 20 article _id:220 article: article2 21 21 filename: my_latest_typo_patch.diff 22 22 mime: 'text/plain' trunk/test/fixtures/tags.yml
r858 r1620 1 1 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 foo_tag: 3 id: 1 2 foo: 4 3 name: foo 5 4 display_name: foo 6 bar_tag: 7 id: 2 5 bar: 8 6 name: bar 9 7 display_name: bar 10 bazz_tag: 11 id: 3 8 bazz: 12 9 name: bazz 13 10 display_name: bazz trunk/test/functional/accounts_controller_test.rb
r1516 r1620 9 9 10 10 class AccountsControllerTest < Test::Unit::TestCase 11 12 fixtures :users, :blogs13 11 14 12 def setup trunk/test/functional/admin/article_preview_test.rb
r1516 r1620 7 7 8 8 class Admin::ArticlePreviewTest < Test::Unit::TestCase 9 fixtures :contents, :users, :categories, :resources, :text_filters, :blogs10 11 9 def setup 12 10 @controller = Admin::ContentController.new trunk/test/functional/admin/blacklist_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::BlacklistControllerTest < Test::Unit::TestCase 8 fixtures :blacklist_patterns, :users9 10 8 def setup 11 9 @controller = Admin::BlacklistController.new … … 37 35 38 36 def test_edit 39 get :edit, 'id' => 137 get :edit, 'id' => blacklist_patterns(:first_blacklist_pattern).id 40 38 assert_template 'edit' 41 39 assert_template_has('blacklist_pattern') … … 44 42 45 43 def test_update 46 post :edit, 'id' => 144 post :edit, 'id' => blacklist_patterns(:first_blacklist_pattern).id 47 45 assert_response :redirect, :action => 'list' 48 46 end 49 47 50 48 def test_destroy 51 assert_not_nil BlacklistPattern.find(1) 49 pattern_id = blacklist_patterns(:first_blacklist_pattern).id 50 assert_not_nil BlacklistPattern.find(pattern_id) 52 51 53 get :destroy, 'id' => 152 get :destroy, 'id' => pattern_id 54 53 assert_response :success 55 54 56 post :destroy, 'id' => 155 post :destroy, 'id' => pattern_id 57 56 assert_response :redirect, :action => 'list' 58 57 59 58 assert_raise(ActiveRecord::RecordNotFound) { 60 blacklist_pattern = BlacklistPattern.find( 1)59 blacklist_pattern = BlacklistPattern.find(pattern_id) 61 60 } 62 61 end trunk/test/functional/admin/categories_controller_test.rb
r1577 r1620 6 6 7 7 class Admin::CategoriesControllerTest < Test::Unit::TestCase 8 fixtures :categories, :users9 10 8 def setup 11 9 @controller = Admin::CategoriesController.new … … 31 29 32 30 def test_show 33 get :show, 'id' => 131 get :show, 'id' => categories(:software).id 34 32 assert_template 'show' 35 33 assert_template_has 'category' … … 47 45 48 46 def test_edit 49 get :edit, :id => 147 get :edit, :id => categories(:software).id 50 48 assert_template 'edit' 51 49 assert_template_has 'category' … … 54 52 55 53 def test_update 56 post :edit, :id => 154 post :edit, :id => categories(:software).id 57 55 assert_response :redirect, :action => 'list' 58 56 end 59 57 60 58 def test_destroy 61 assert_not_nil Category.find(1) 59 test_id = categories(:software).id 60 assert_not_nil Category.find(test_id) 62 61 63 get :destroy, :id => 162 get :destroy, :id => test_id 64 63 assert_response :success 65 64 assert_template 'destroy' 66 65 67 post :destroy, :id => 166 post :destroy, :id => test_id 68 67 assert_response :redirect, :action => 'list' 69 68 70 assert_raise(ActiveRecord::RecordNotFound) { Category.find( 1) }69 assert_raise(ActiveRecord::RecordNotFound) { Category.find(test_id) } 71 70 end 72 71 trunk/test/functional/admin/comments_controller_test.rb
r1516 r1620 7 7 8 8 class Admin::CommentsControllerTest < Test::Unit::TestCase 9 fixtures :contents, :feedback, :users, :notifications, :blogs, :blacklist_patterns10 11 9 def setup 12 10 @controller = Admin::CommentsController.new … … 15 13 16 14 @request.session = { :user_id => users(:tobi).id } 15 @art_id = contents(:article2).id 17 16 end 18 17 19 18 def test_index 20 get :index, :article_id => 219 get :index, :article_id => @art_id 21 20 assert_template 'list' 22 21 end 23 22 24 23 def test_list 25 get :list, :article_id => 224 get :list, :article_id => @art_id 26 25 assert_template 'list' 27 26 assert_template_has 'comments' … … 29 28 30 29 def test_show 31 get :show, :id => feedback(:spam_comment).id, :article_id => 230 get :show, :id => feedback(:spam_comment).id, :article_id => @art_id 32 31 assert_template 'show' 33 32 assert_template_has 'comment' … … 36 35 37 36 def test_new 38 get :new, :article_id => 237 get :new, :article_id => @art_id 39 38 assert_template 'new' 40 39 assert_template_has 'comment' … … 45 44 46 45 post(:new, :comment => { 'author' => 'author', 'body' => 'body' }, 47 :article_id => 2)46 :article_id => @art_id) 48 47 assert_response :redirect, :action => 'show' 49 48 … … 52 51 53 52 def test_edit 54 get :edit, :id => feedback(:spam_comment).id, :article_id => 253 get :edit, :id => feedback(:spam_comment).id, :article_id => @art_id 55 54 assert_template 'edit' 56 55 assert_template_has 'comment' … … 59 58 60 59 def test_update 61 post :edit, :id => feedback(:spam_comment).id, :article_id => 260 post :edit, :id => feedback(:spam_comment).id, :article_id => @art_id 62 61 assert_response :redirect, :action => 'show', :id => feedback(:spam_comment).id 63 62 end … … 66 65 assert_not_nil Comment.find(feedback(:spam_comment).id) 67 66 68 get :destroy, :id => feedback(:spam_comment).id, :article_id => 267 get :destroy, :id => feedback(:spam_comment).id, :article_id => @art_id 69 68 assert_response :success 70 69 71 post :destroy, :id => feedback(:spam_comment).id, :article_id => 270 post :destroy, :id => feedback(:spam_comment).id, :article_id => @art_id 72 71 assert_response :redirect, :action => 'list' 73 72 trunk/test/functional/admin/content_controller_test.rb
r1602 r1620 8 8 9 9 class Admin::ContentControllerTest < Test::Unit::TestCase 10 fixtures :contents, :feedback, :users, :categories, :resources, :text_filters,11 :blogs, :categorizations12 13 10 def setup 14 11 @controller = Admin::ContentController.new … … 30 27 31 28 def test_show 32 get :show, 'id' => 129 get :show, 'id' => contents(:article1).id 33 30 assert_template 'show' 34 31 assert_template_has 'article' … … 49 46 :keywords => "tagged", 50 47 :allow_comments => '0', :allow_pings => '1' }, 51 'categories' => [ 1])48 'categories' => [categories(:software).id]) 52 49 assert !assigns(:article).allow_comments? 53 50 assert assigns(:article).allow_pings? … … 59 56 :keywords => "tagged", 60 57 :allow_comments => '1', :allow_pings => '0' }, 61 'categories' => [ 1])58 'categories' => [categories(:software).id]) 62 59 assert assigns(:article).allow_comments? 63 60 assert !assigns(:article).allow_pings? … … 71 68 emails = ActionMailer::Base.deliveries 72 69 tags = ['foo', 'bar', 'baz bliz', 'gorp gack gar'] 73 post :new, 'article' => { :title => "posted via tests!", :body => "Foo", :keywords => "foo bar 'baz bliz' \"gorp gack gar\""}, 'categories' => [ 1]70 post :new, 'article' => { :title => "posted via tests!", :body => "Foo", :keywords => "foo bar 'baz bliz' \"gorp gack gar\""}, 'categories' => [categories(:software).id] 74 71 assert_response :redirect, :action => 'show' 75 72 … … 79 76 assert_equal users(:tobi), new_article.user 80 77 assert_equal 1, new_article.categories.size 81 assert_equal [ 1], new_article.categories.collect {|c| c.id}78 assert_equal [categories(:software)], new_article.categories 82 79 assert_equal 4, new_article.tags.size 83 80 … … 126 123 127 124 def test_edit 128 get :edit, 'id' => 1129 assert_equal assigns(:selected), Article.find(1).categories.collect {|c| c.id}125 get :edit, 'id' => contents(:article1).id 126 assert_equal assigns(:selected), contents(:article1).categories.collect {|c| c.id} 130 127 assert_template 'edit' 131 128 assert_template_has 'article' … … 138 135 emails.clear 139 136 137 art_id = contents(:article1).id 138 140 139 body = "another *textile* test" 141 post :edit, 'id' => 1, 'article' => {:body => body, :text_filter => 'textile'}142 assert_response :redirect, :action => 'show', :id => 1143 144 article = Article.find(1)140 post :edit, 'id' => art_id, 'article' => {:body => body, :text_filter => 'textile'} 141 assert_response :redirect, :action => 'show', :id => art_id 142 143 article = contents(:article1).reload 145 144 assert_equal "textile", article.text_filter.name 146 145 assert_equal body, article.body … … 152 151 153 152 def test_destroy 154 assert_not_nil Article.find(1) 155 156 get :destroy, 'id' => 1 153 art_id = contents(:article1).id 154 assert_not_nil Article.find(art_id) 155 156 get :destroy, 'id' => art_id 157 157 assert_response :success 158 158 159 post :destroy, 'id' => 1159 post :destroy, 'id' => art_id 160 160 assert_response :redirect, :action => 'list' 161 161 162 162 assert_raise(ActiveRecord::RecordNotFound) { 163 article = Article.find( 1)163 article = Article.find(art_id) 164 164 } 165 165 end 166 166 167 167 def test_category_add 168 get :category_add, :id => 1, :category_id => 1 168 art_id = contents(:article1).id 169 get :category_add, :id => art_id, :category_id => categories(:software).id 169 170 170 171 assert_template '_show_categories' 171 172 assert_valid assigns(:article) 172 173 assert_valid assigns(:category) 173 assert Article.find( 1).categories.include?(Category.find(1))174 assert Article.find(art_id).categories.include?(categories(:software)) 174 175 assert_not_nil assigns(:article) 175 176 assert_not_nil assigns(:category) … … 178 179 179 180 def test_category_remove 180 get :category_remove, :id => 1, :category_id => 1 181 art_id = contents(:article1).id 182 get :category_remove, :id => art_id, :category_id => categories(:software).id 181 183 182 184 assert_template '_show_categories' 183 185 assert_valid assigns(:article) 184 186 assert_valid assigns(:category) 185 assert !Article.find( 1).categories.include?(Category.find(1))187 assert !Article.find(art_id).categories.include?(categories(:software)) 186 188 assert_not_nil assigns(:article) 187 189 assert_not_nil assigns(:category) … … 190 192 191 193 def test_resource_add 192 get :resource_add, :id => 1, :resource_id => 1 194 art_id = contents(:article1).id 195 get :resource_add, :id => art_id, :resource_id => 1 193 196 194 197 assert_template '_show_resources' 195 198 assert_valid assigns(:article) 196 199 assert_valid assigns(:resource) 197 assert Article.find( 1).resources.include?(Resource.find(1))200 assert Article.find(art_id).resources.include?(Resource.find(1)) 198 201 assert_not_nil assigns(:article) 199 202 assert_not_nil assigns(:resource) … … 202 205 203 206 def test_resource_remove 204 get :resource_remove, :id => 1, :resource_id => 1 207 art_id = contents(:article1).id 208 get :resource_remove, :id => art_id, :resource_id => 1 205 209 206 210 assert_template '_show_resources' 207 211 assert_valid assigns(:article) 208 212 assert_valid assigns(:resource) 209 assert !Article.find( 1).resources.include?(Resource.find(1))213 assert !Article.find(art_id).resources.include?(Resource.find(1)) 210 214 assert_not_nil assigns(:article) 211 215 assert_not_nil assigns(:resource) trunk/test/functional/admin/feedback_controller_test.rb
r1516 r1620 8 8 9 9 class Admin::FeedbackControllerTest < Test::Unit::TestCase 10 fixtures :contents, :users, :resources, :text_filters,11 :blogs, :categorizations, :feedback, :blacklist_patterns, :categories12 13 10 def setup 14 11 @controller = Admin::FeedbackController.new trunk/test/functional/admin/pages_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::PagesControllerTest < Test::Unit::TestCase 8 fixtures :contents, :users, :text_filters, :blogs9 10 8 def setup 11 9 @controller = Admin::PagesController.new trunk/test/functional/admin/resources_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::ResourcesControllerTest < Test::Unit::TestCase 8 fixtures :users, :resources9 10 8 def setup 11 9 @controller = Admin::ResourcesController.new trunk/test/functional/admin/settings_controller_test.rb
r1611 r1620 6 6 7 7 class Admin::SettingsControllerTest < Test::Unit::TestCase 8 fixtures :users9 10 8 def setup 11 9 @controller = Admin::SettingsController.new trunk/test/functional/admin/textfilters_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::TextfiltersControllerTest < Test::Unit::TestCase 8 fixtures :text_filters, :users9 10 8 def setup 11 9 @controller = Admin::TextfiltersController.new trunk/test/functional/admin/themes_controller_test.rb
r1570 r1620 6 6 7 7 class Admin::ThemesControllerTest < Test::Unit::TestCase 8 fixtures :users9 10 8 def setup 11 9 @controller = Admin::ThemesController.new trunk/test/functional/admin/trackbacks_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::TrackbacksControllerTest < Test::Unit::TestCase 8 fixtures :contents, :feedback, :users9 10 8 def setup 11 9 @controller = Admin::TrackbacksController.new … … 14 12 15 13 @request.session = { :user_id => users(:tobi).id } 14 @art_id = contents(:article2).id 16 15 end 17 16 18 17 def test_index 19 get :index, :article_id => 218 get :index, :article_id => @art_id 20 19 assert_template 'list' 21 20 end 22 21 23 22 def test_list 24 get :list, :article_id => 223 get :list, :article_id => @art_id 25 24 assert_template 'list' 26 25 assert_template_has 'trackbacks' … … 28 27 29 28 def test_show 30 get :show, :id => feedback(:trackback1).id, :article_id => 229 get :show, :id => feedback(:trackback1).id, :article_id => @art_id 31 30 assert_template 'show' 32 31 assert_template_has 'trackback' … … 35 34 36 35 def test_new 37 get :new, :article_id => 236 get :new, :article_id => @art_id 38 37 assert_template 'new' 39 38 assert_template_has 'trackback' … … 43 42 num_trackbacks = Trackback.count 44 43 45 post :new, :trackback => { 'title' => 'title', 'excerpt' => 'excerpt', 'blog_name' => 'blog_name', 'url' => 'url' }, :article_id => 244 post :new, :trackback => { 'title' => 'title', 'excerpt' => 'excerpt', 'blog_name' => 'blog_name', 'url' => 'url' }, :article_id => @art_id 46 45 assert_response :redirect, :action => 'show' 47 46 … … 50 49 51 50 def test_edit 52 get :edit, :id => feedback(:trackback1).id, :article_id => 251 get :edit, :id => feedback(:trackback1).id, :article_id => @art_id 53 52 assert_template 'edit' 54 53 assert_template_has 'trackback' … … 57 56 58 57 def test_update 59 post :edit, :id => feedback(:trackback1).id, :article_id => 258 post :edit, :id => feedback(:trackback1).id, :article_id => @art_id 60 59 assert_response :redirect, :action => 'show', :id => feedback(:trackback1).id 61 60 end … … 64 63 assert_not_nil Trackback.find(feedback(:trackback1).id) 65 64 66 get :destroy, :id => feedback(:trackback1).id, :article_id => 265 get :destroy, :id => feedback(:trackback1).id, :article_id => @art_id 67 66 assert_response :success 68 67 69 post :destroy, :id => feedback(:trackback1).id, :article_id => 268 post :destroy, :id => feedback(:trackback1).id, :article_id => @art_id 70 69 assert_response :redirect, :action => 'list' 71 70 trunk/test/functional/admin/users_controller_test.rb
r1516 r1620 6 6 7 7 class Admin::UsersControllerTest < Test::Unit::TestCase 8 fixtures :users, :blogs, :profiles9 10 8 def setup 11 9 @controller = Admin::UsersController.new trunk/test/functional/articles_controller_test.rb
r1614 r1620 18 18 19 19 class ArticlesControllerTest < Test::Unit::TestCase 20 fixtures :contents, :feedback, :categories, :blogs, :users, :categorizations, :text_filters, :articles_tags, :tags21 20 include ArticlesHelper 22 21 … … 136 135 137 136 def test_show_non_published 138 show_article( Article.find(4))137 show_article(contents(:article4)) 139 138 assert_response 404 140 139 assert_template "error" … … 143 142 def test_gravatar 144 143 assert ! this_blog.use_gravatar 145 show_article( Article.find(1))144 show_article(contents(:article1)) 146 145 assert_response :success 147 146 assert_template "read" … … 153 152 @controller = ArticlesController.new 154 153 assert this_blog.use_gravatar 155 show_article( Article.find(1))154 show_article(contents(:article1)) 156 155 assert_response :success 157 156 assert_template "read" … … 219 218 220 219 def test_autodiscovery_article 221 show_article( Article.find(1))220 show_article(contents(:article1)) 222 221 assert_response :success 223 222 … … 225 224 assert_select '[rel=alternate]' 226 225 assert_select '[type=application/rss+xml]' 227 assert_select '[href=?]', formatted_article_url( Article.find(1), 'rss')226 assert_select '[href=?]', formatted_article_url(contents(:article1), 'rss') 228 227 end 229 228 assert_select 'link[title=Atom]' do 230 229 assert_select '[rel=alternate]' 231 230 assert_select '[type=application/atom+xml]' 232 assert_select '[href=?]', formatted_article_url( Article.find(1), 'atom')231 assert_select '[href=?]', formatted_article_url(contents(:article1), 'atom') 233 232 end 234 233 end trunk/test/functional/backend_controller_test.rb
r1552 r1620 11 11 class BackendControllerTest < Test::Unit::TestCase 12 12 include FlexMock::TestCase 13 fixtures :contents, :categories, :blogs, :users, :categorizations, :text_filters, :blacklist_patterns, :feedback, :tags, :articles_tags, :notifications, :resources, :triggers14 13 15 14 def setup … … 21 20 # BloggerApi Tests 22 21 def test_blogger_delete_post 23 args = [ 'foo', 3, 'tobi', 'whatever', 1 ]22 args = [ 'foo', contents(:article3).id, 'tobi', 'whatever', 1 ] 24 23 25 24 result = invoke_layered :blogger, :deletePost, *args 26 assert_raise(ActiveRecord::RecordNotFound) { Article.find( 3) }25 assert_raise(ActiveRecord::RecordNotFound) { Article.find(contents(:article3).id) } 27 26 end 28 27 … … 106 105 107 106 def test_meta_weblog_get_post
