Removed unused let blocks (#7446)

Removed unused let blocks (#7446)

The bodies of these blocks were never evaluated.

diff --git a/spec/components/filter_best_posts_spec.rb b/spec/components/filter_best_posts_spec.rb
index 532c1f4..62fab56 100644
--- a/spec/components/filter_best_posts_spec.rb
+++ b/spec/components/filter_best_posts_spec.rb
@@ -8,8 +8,6 @@ describe FilterBestPosts do
   let(:coding_horror) { Fabricate(:coding_horror) }
   let(:first_poster) { topic.user }
 
-  let(:topic_view) { TopicView.new(topic.id, coding_horror) }
-
   let!(:p1) { Fabricate(:post, topic: topic, user: first_poster, percent_rank: 1) }
   let!(:p2) { Fabricate(:post, topic: topic, user: coding_horror, percent_rank: 0.5) }
   let!(:p3) { Fabricate(:post, topic: topic, user: first_poster, percent_rank: 0) }
diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rb
index afe2606..a6b1eee 100644
--- a/spec/components/guardian_spec.rb
+++ b/spec/components/guardian_spec.rb
@@ -1181,8 +1181,6 @@ describe Guardian do
     end
 
     context 'as a moderator' do
-      let(:other_post) { Fabricate(:post, topic: topic, user: topic.user) }
-
       before do
         topic.save!
         post.save!
diff --git a/spec/components/pinned_check_spec.rb b/spec/components/pinned_check_spec.rb
index edaba32..b8b9dc2 100644
--- a/spec/components/pinned_check_spec.rb
+++ b/spec/components/pinned_check_spec.rb
@@ -21,7 +21,6 @@ describe PinnedCheck do
 
   context "with a topic_user record" do
     let(:user) { Fabricate.build(:user) }
-    let(:unpinned_topic_user) { Fabricate.build(:topic_user, user: user, topic: unpinned_topic) }
 
     describe "unpinned topic" do
       let(:topic_user) { TopicUser.new(topic: unpinned_topic, user: user) }
diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb
index b76a253..1c780e8 100644
--- a/spec/components/pretty_text_spec.rb
+++ b/spec/components/pretty_text_spec.rb
@@ -16,7 +16,6 @@ describe PrettyText do
   end
 
   let(:wrapped_image) { "<div class=\"lightbox-wrapper\"><a href=\"//localhost:3000/uploads/default/4399/33691397e78b4d75.png\" class=\"lightbox\" title=\"Screen Shot 2014-04-14 at 9.47.10 PM.png\"><img src=\"//localhost:3000/uploads/default/_optimized/bd9/b20/bbbcd6a0c0_655x500.png\" width=\"655\" height=\"500\"><div class=\"meta\">\n<span class=\"filename\">Screen Shot 2014-04-14 at 9.47.10 PM.png</span><span class=\"informations\">966x737 1.47 MB</span><span class=\"expand\"></span>\n</div></a></div>" }
-  let(:wrapped_image_excerpt) {}
 
   describe "Quoting" do
 
diff --git a/spec/components/s3_inventory_spec.rb b/spec/components/s3_inventory_spec.rb
index b673464..f4da267 100644
--- a/spec/components/s3_inventory_spec.rb
+++ b/spec/components/s3_inventory_spec.rb
@@ -6,7 +6,6 @@ require "file_store/s3_store"
 describe "S3Inventory" do
   let(:client) { Aws::S3::Client.new(stub_responses: true) }
   let(:helper) { S3Helper.new(SiteSetting.Upload.s3_upload_bucket.downcase, "", client: client) }
-  let(:store) { FileStore::S3Store.new(helper) }
   let(:inventory) { S3Inventory.new(helper, :upload) }
   let(:csv_filename) { "#{Rails.root}/spec/fixtures/csv/s3_inventory.csv" }
 
diff --git a/spec/components/site_settings/type_supervisor_spec.rb b/spec/components/site_settings/type_supervisor_spec.rb
index 692923f..f795d82 100644
--- a/spec/components/site_settings/type_supervisor_spec.rb
+++ b/spec/components/site_settings/type_supervisor_spec.rb
@@ -233,9 +233,6 @@ describe SiteSettings::TypeSupervisor do
     end
 
     describe '#to_rb_value' do
-      let(:true_val) { 't' }
-      let(:false_val) { 'f' }
-
       it 'the type can be overriden by a parameter' do
         expect(settings.type_supervisor.to_rb_value(:type_null, '1', SiteSetting.types[:integer])).to eq(1)
       end
diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb
index 31138e6..ad375ed 100644
--- a/spec/components/topic_query_spec.rb
+++ b/spec/components/topic_query_spec.rb
@@ -525,8 +525,6 @@ describe TopicQuery do
     end
 
     context 'preload api' do
-      let(:topics) {}
-
       it "preloads data correctly" do
         TopicList.preloaded_custom_fields << "tag"
         TopicList.preloaded_custom_fields << "age"
diff --git a/spec/components/validators/email_validator_spec.rb b/spec/components/validators/email_validator_spec.rb
index 36a4202..9e52e83 100644
--- a/spec/components/validators/email_validator_spec.rb
+++ b/spec/components/validators/email_validator_spec.rb
@@ -1,11 +1,6 @@
 require 'rails_helper'
 
 describe EmailValidator do
-
-  let(:record) {}
-  let(:validator) { described_class.new(attributes: :email) }
-  subject(:validate) { validator.validate_each(record, :email, record.email) }
-
   def blocks?(email)
     user = Fabricate.build(:user, email: email)
     validator = EmailValidator.new(attributes: :email)
diff --git a/spec/integration/category_tag_spec.rb b/spec/integration/category_tag_spec.rb
index e855786..d29b2f2 100644
--- a/spec/integration/category_tag_spec.rb
+++ b/spec/integration/category_tag_spec.rb
@@ -289,7 +289,6 @@ describe "category tag restrictions" do
 end
 
 describe "tag topic counts per category" do
-  let(:user)  { Fabricate(:user) }
   let(:admin) { Fabricate(:admin) }
   let(:category) { Fabricate(:category) }
   let(:category2) { Fabricate(:category) }
diff --git a/spec/jobs/bulk_invite_spec.rb b/spec/jobs/bulk_invite_spec.rb
index bf3b7ea..736d6f0 100644
--- a/spec/jobs/bulk_invite_spec.rb
+++ b/spec/jobs/bulk_invite_spec.rb
@@ -8,7 +8,6 @@ describe Jobs::BulkInvite do
     let!(:group2) { Fabricate(:group, name: 'group2') }
     let!(:topic) { Fabricate(:topic, id: 999) }
     let(:email) { "test@discourse.org" }
-    let(:csv_info) { [] }
     let(:basename) { "bulk_invite.csv" }
     let(:filename) { "#{Invite.base_directory}/#{basename}" }
 
diff --git a/spec/jobs/clean_up_uploads_spec.rb b/spec/jobs/clean_up_uploads_spec.rb
index bcd2966..645b7a1 100644
--- a/spec/jobs/clean_up_uploads_spec.rb
+++ b/spec/jobs/clean_up_uploads_spec.rb
@@ -8,8 +8,6 @@ describe Jobs::CleanUpUploads do
     Fabricate(:upload, { created_at: 2.hours.ago }.merge(attributes))
   end
 
-  let(:upload) { fabricate_upload }
-
   before do
     SiteSetting.clean_up_uploads = true
     SiteSetting.clean_orphan_uploads_grace_period_hours = 1
diff --git a/spec/jobs/enqueue_digest_emails_spec.rb b/spec/jobs/enqueue_digest_emails_spec.rb
index d468793..e408676 100644
--- a/spec/jobs/enqueue_digest_emails_spec.rb
+++ b/spec/jobs/enqueue_digest_emails_spec.rb
@@ -74,7 +74,6 @@ describe Jobs::EnqueueDigestEmails do
 
     context 'visited the site this week' do
       let(:user_visited_this_week) { Fabricate(:active_user, last_seen_at: 6.days.ago) }
-      let(:user_visited_this_week_email_always) { Fabricate(:active_user, last_seen_at: 6.days.ago, email_level: UserOption.email_level_types[:always]) }
 
       it "doesn't return users who have been emailed recently" do
         user = user_visited_this_week
diff --git a/spec/jobs/poll_feed_spec.rb b/spec/jobs/poll_feed_spec.rb
index 8b151c7..830648d 100644
--- a/spec/jobs/poll_feed_spec.rb
+++ b/spec/jobs/poll_feed_spec.rb
@@ -6,7 +6,6 @@ describe Jobs::PollFeed do
 
   context "execute" do
     let(:url) { "http://eviltrout.com" }
-    let(:embed_by_username) { "eviltrout" }
 
     before do
       $redis.del("feed-polled-recently")
diff --git a/spec/jobs/poll_mailbox_spec.rb b/spec/jobs/poll_mailbox_spec.rb
index d9c7d48..b4efaff 100644
--- a/spec/jobs/poll_mailbox_spec.rb
+++ b/spec/jobs/poll_mailbox_spec.rb
@@ -24,8 +24,6 @@ describe Jobs::PollMailbox do
   describe ".poll_pop3" do
 
     context "pop errors" do
-      let(:user) { Fabricate(:user) }
-
       before do
         Discourse.expects(:handle_job_exception).at_least_once
       end
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb
index 96eb5c7..8b24245 100644
--- a/spec/models/post_spec.rb
+++ b/spec/models/post_spec.rb
@@ -403,7 +403,6 @@ describe Post do
 
       context "with a previous host" do
 
-        let(:user) { old_post.newuser }

[... diff too long, it was truncated ...]

GitHub sha: ad44243a