docbrown/spec/requests/liquid_embeds_spec.rb
Fabbri Paolo 89e893f157 Fix rubocop detected offenses (#4552)
* Run Inspecting 1050 files
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.....................................................................................................................................................................................................................................................................................................

Offenses:

spec/models/article_spec.rb:195:7: C: RSpec/NestedGroups: Maximum example group nesting exceeded [4/3]. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups)
      context "when description is empty" do
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1050 files inspected, 1 offense detected to fix autofixable errors

* Refactor  to correct test

it was braking the rule RSpec/NestedGroups: Maximum example group nesting exceeded [4/3]. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups)

* Run `rubocop --auto-gen-config` to regenrate `.rubocop_todo.yml`
2019-10-24 11:53:03 -04:00

21 lines
526 B
Ruby

require "rails_helper"
vcr_option = {
cassette_name: "twitter_gem",
allow_playback_repeats: "true"
}
RSpec.describe "LiquidEmbeds", type: :request, vcr: vcr_option do
describe "get /embeds" do
it "renders proper tweet" do
get "/embed/tweet?args=1018911886862057472"
expect(response.body).to include("ltag__twitter-tweet")
end
it "renders 404 if improper tweet" do
expect do
get "/embed/tweet?args=improper"
end.to raise_error(ActionView::Template::Error)
end
end
end