about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/controllers/admin/comments_controller_test.rb8
-rw-r--r--test/controllers/admin/quotes_controller_test.rb13
-rw-r--r--test/controllers/comments_controller_test.rb8
-rw-r--r--test/controllers/quotes_controller_test.rb18
-rw-r--r--test/controllers/webmentions_controller_test.rb8
-rw-r--r--test/fixtures/comments.yml17
-rw-r--r--test/fixtures/globals.yml11
-rw-r--r--test/fixtures/quotes.yml17
-rw-r--r--test/fixtures/scrobbles.yml13
-rw-r--r--test/jobs/send_webmentions_job_test.rb7
-rw-r--r--test/mailers/comment_mailer_test.rb7
-rw-r--r--test/mailers/previews/comment_mailer_preview.rb4
-rw-r--r--test/mailers/previews/vote_mailer_preview.rb11
-rw-r--r--test/mailers/vote_mailer_test.rb12
-rw-r--r--test/models/comment_test.rb7
-rw-r--r--test/models/global_test.rb7
-rw-r--r--test/models/quote_test.rb7
-rw-r--r--test/models/scrobble_test.rb7
18 files changed, 182 insertions, 0 deletions
diff --git a/test/controllers/admin/comments_controller_test.rb b/test/controllers/admin/comments_controller_test.rb new file mode 100644 index 0000000..33f1a47 --- /dev/null +++ b/test/controllers/admin/comments_controller_test.rb
@@ -0,0 +1,8 @@
1require "test_helper"
2
3class Admin::CommentsControllerTest < ActionDispatch::IntegrationTest
4 test "should get index" do
5 get admin_comments_index_url
6 assert_response :success
7 end
8end
diff --git a/test/controllers/admin/quotes_controller_test.rb b/test/controllers/admin/quotes_controller_test.rb new file mode 100644 index 0000000..4f5939b --- /dev/null +++ b/test/controllers/admin/quotes_controller_test.rb
@@ -0,0 +1,13 @@
1require "test_helper"
2
3class Admin::QuotesControllerTest < ActionDispatch::IntegrationTest
4 test "should get index" do
5 get admin_quotes_index_url
6 assert_response :success
7 end
8
9 test "should get pending" do
10 get admin_quotes_pending_url
11 assert_response :success
12 end
13end
diff --git a/test/controllers/comments_controller_test.rb b/test/controllers/comments_controller_test.rb new file mode 100644 index 0000000..3bcb0dc --- /dev/null +++ b/test/controllers/comments_controller_test.rb
@@ -0,0 +1,8 @@
1require "test_helper"
2
3class CommentsControllerTest < ActionDispatch::IntegrationTest
4 test "should get create" do
5 get comments_create_url
6 assert_response :success
7 end
8end
diff --git a/test/controllers/quotes_controller_test.rb b/test/controllers/quotes_controller_test.rb new file mode 100644 index 0000000..a085d40 --- /dev/null +++ b/test/controllers/quotes_controller_test.rb
@@ -0,0 +1,18 @@
1require "test_helper"
2
3class QuotesControllerTest < ActionDispatch::IntegrationTest
4 test "should get index" do
5 get quotes_index_url
6 assert_response :success
7 end
8
9 test "should get show" do
10 get quotes_show_url
11 assert_response :success
12 end
13
14 test "should get new" do
15 get quotes_new_url
16 assert_response :success
17 end
18end
diff --git a/test/controllers/webmentions_controller_test.rb b/test/controllers/webmentions_controller_test.rb new file mode 100644 index 0000000..cc7bb42 --- /dev/null +++ b/test/controllers/webmentions_controller_test.rb
@@ -0,0 +1,8 @@
1require "test_helper"
2
3class WebmentionsControllerTest < ActionDispatch::IntegrationTest
4 test "should get create" do
5 get webmentions_create_url
6 assert_response :success
7 end
8end
diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml new file mode 100644 index 0000000..1d6475a --- /dev/null +++ b/test/fixtures/comments.yml
@@ -0,0 +1,17 @@
1# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
3one:
4 blog: one
5 username: MyString
6 email: MyString
7 website: MyString
8 body: MyText
9 status: MyString
10
11two:
12 blog: two
13 username: MyString
14 email: MyString
15 website: MyString
16 body: MyText
17 status: MyString
diff --git a/test/fixtures/globals.yml b/test/fixtures/globals.yml new file mode 100644 index 0000000..bb636b7 --- /dev/null +++ b/test/fixtures/globals.yml
@@ -0,0 +1,11 @@
1# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
3one:
4 key: MyString
5 string_value: MyString
6 int_value: 1
7
8two:
9 key: MyString
10 string_value: MyString
11 int_value: 1
diff --git a/test/fixtures/quotes.yml b/test/fixtures/quotes.yml new file mode 100644 index 0000000..761703f --- /dev/null +++ b/test/fixtures/quotes.yml
@@ -0,0 +1,17 @@
1# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
3one:
4 content: MyText
5 state: MyString
6 submitter: MyString
7 notes: MyText
8 upvotes: 1
9 downvotes: 1
10
11two:
12 content: MyText
13 state: MyString
14 submitter: MyString
15 notes: MyText
16 upvotes: 1
17 downvotes: 1
diff --git a/test/fixtures/scrobbles.yml b/test/fixtures/scrobbles.yml new file mode 100644 index 0000000..9ca535d --- /dev/null +++ b/test/fixtures/scrobbles.yml
@@ -0,0 +1,13 @@
1# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
3one:
4 title: MyString
5 artist: MyString
6 album: MyString
7 image: MyString
8
9two:
10 title: MyString
11 artist: MyString
12 album: MyString
13 image: MyString
diff --git a/test/jobs/send_webmentions_job_test.rb b/test/jobs/send_webmentions_job_test.rb new file mode 100644 index 0000000..72f6ed7 --- /dev/null +++ b/test/jobs/send_webmentions_job_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class SendWebmentionsJobTest < ActiveJob::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end
diff --git a/test/mailers/comment_mailer_test.rb b/test/mailers/comment_mailer_test.rb new file mode 100644 index 0000000..996d230 --- /dev/null +++ b/test/mailers/comment_mailer_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class CommentMailerTest < ActionMailer::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end
diff --git a/test/mailers/previews/comment_mailer_preview.rb b/test/mailers/previews/comment_mailer_preview.rb new file mode 100644 index 0000000..20fc4e6 --- /dev/null +++ b/test/mailers/previews/comment_mailer_preview.rb
@@ -0,0 +1,4 @@
1# Preview all emails at http://localhost:3000/rails/mailers/comment_mailer
2class CommentMailerPreview < ActionMailer::Preview
3
4end
diff --git a/test/mailers/previews/vote_mailer_preview.rb b/test/mailers/previews/vote_mailer_preview.rb new file mode 100644 index 0000000..dfc5da1 --- /dev/null +++ b/test/mailers/previews/vote_mailer_preview.rb
@@ -0,0 +1,11 @@
1# Preview all emails at http://localhost:3000/rails/mailers/vote_mailer
2class VoteMailerPreview < ActionMailer::Preview
3
4 # Preview this email at http://localhost:3000/rails/mailers/vote_mailer/daily_report_email
5 def daily_report_email
6 # Duplicating logic from the task... love it
7 votes = Vote.where("created_at > ?", 1.day.ago).where(upvote: 1).all
8 VoteMailer.with(votes: votes).daily_report_email
9 end
10
11end
diff --git a/test/mailers/vote_mailer_test.rb b/test/mailers/vote_mailer_test.rb new file mode 100644 index 0000000..efe8236 --- /dev/null +++ b/test/mailers/vote_mailer_test.rb
@@ -0,0 +1,12 @@
1require "test_helper"
2
3class VoteMailerTest < ActionMailer::TestCase
4 test "daily_report_email" do
5 mail = VoteMailer.daily_report_email
6 assert_equal "Daily report email", mail.subject
7 assert_equal ["to@example.org"], mail.to
8 assert_equal ["from@example.com"], mail.from
9 assert_match "Hi", mail.body.encoded
10 end
11
12end
diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb new file mode 100644 index 0000000..5a6feda --- /dev/null +++ b/test/models/comment_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class CommentTest < ActiveSupport::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end
diff --git a/test/models/global_test.rb b/test/models/global_test.rb new file mode 100644 index 0000000..2e42136 --- /dev/null +++ b/test/models/global_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class GlobalTest < ActiveSupport::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end
diff --git a/test/models/quote_test.rb b/test/models/quote_test.rb new file mode 100644 index 0000000..d58ff5c --- /dev/null +++ b/test/models/quote_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class QuoteTest < ActiveSupport::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end
diff --git a/test/models/scrobble_test.rb b/test/models/scrobble_test.rb new file mode 100644 index 0000000..48541da --- /dev/null +++ b/test/models/scrobble_test.rb
@@ -0,0 +1,7 @@
1require "test_helper"
2
3class ScrobbleTest < ActiveSupport::TestCase
4 # test "the truth" do
5 # assert true
6 # end
7end