Skip to content

Commit

Permalink
Remove spec type from RSpec examples
Browse files Browse the repository at this point in the history
RSpec generates the rails_helper file with
`config.infer_spec_type_from_file_location!` turned on, which auto
detects what type of spec a spec is based on the file location.
  • Loading branch information
tombruijn committed May 20, 2023
1 parent b92b082 commit 172c66a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _pages/testing-rspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Inside the new test file, we will want to make sure our idea has a name. In orde
{% highlight ruby %}
require "rails_helper"

RSpec.describe Idea, type: :model do
RSpec.describe Idea do
it "has a name" do
skip
end
Expand All @@ -78,7 +78,7 @@ Let's add something to our test to make sure the idea has a name!
{% highlight ruby %}
require "rails_helper"

RSpec.describe Idea, type: :model do
RSpec.describe Idea do
it "has a name" do # yep, you can totally use 'it'
idea = Idea.create!(name: "My Awesome Idea Name") # creating a new idea 'instance'
expect(idea.name).to eq("My Awesome Idea Name") # this is our expectation
Expand Down Expand Up @@ -115,7 +115,7 @@ We have our first test, we test if our idea has a name, but our idea can hold ma
{% highlight ruby %}
require "rails_helper"

RSpec.describe Idea, type: :model do
RSpec.describe Idea do
# Your other tests here...

it "has comments" do
Expand Down

0 comments on commit 172c66a

Please sign in to comment.