Skip to content

Commit 1f1232f

Browse files
camillevillatjgrathwell
authored andcommitted
Fix RSpec example typos
1 parent 0a8e8c6 commit 1f1232f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sites/en/testing/types_of_tests.step

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ steps do
2020
message "First, create a orange model. By creating the model, a spec file will also be added to the models folder of the spec folder. Type this in the terminal:"
2121

2222
console_without_message "rails g model Orange"
23-
23+
2424
message "Then, run the migration to actually create the oranges table."
2525

2626
console_without_message "bundle exec rake db:migrate"
@@ -33,12 +33,12 @@ steps do
3333
message "You should see some report but no tests exist yet. So, let's add one! Copy the below test, paste it into the orange model spec file and then run 'bundle exec rspec' on the terminal again."
3434

3535
console_without_message <<-RUBY
36-
Rspec.describe Orange, :type => :model do
36+
RSpec.describe Orange, :type => :model do
3737
context 'ActiveRecord associations' do
3838
it 'Orange belongs to tree' do
3939
expect(Orange.reflect_on_association(:tree).macro).to be (:belongs_to)
4040
end
41-
end
41+
end
4242
end
4343
RUBY
4444

@@ -66,13 +66,13 @@ steps do
6666
message "You should see a report with some passing tests but those are just the model tests you wrote. So, let's add some controller tests! Copy the below test, paste it into the oranges controller spec file, create the relevant view files and then run 'bundle exec rspec' on the terminal again."
6767

6868
console_without_message <<-RUBY
69-
Rspec.describe OrangesController do
69+
RSpec.describe OrangesController do
7070
context '#index' do
7171
it "renders the index view" do
7272
get :index
7373
expect(response).to render_template("index")
7474
end
75-
75+
7676
it "renders html" do
7777
process :index, method: :get
7878
expect(response.content_type).to eq "text/html"
@@ -82,7 +82,7 @@ steps do
8282
RUBY
8383

8484
message "Great, that test should be passing! That's an example of a controller test on the index action. Let's modify that test to fail. Then, run 'bundle exec rspec' and see what happens. Awesome! Let's revert back to the passing test. Now, write another controller test for the new action (hint: you might need to look up what a mock is)."
85-
85+
8686
message "Note: as you write the controller tests, you may be prompted to install a missing gem called 'rails-controller-testing' to use the assert_template method. If prompted, please add it and do a bundle install!"
8787
end
8888
end
@@ -134,10 +134,10 @@ MARKDOWN
134134
img src: "img/rails-test-types.png", alt: "Thoughtbot's diagram of types of Rails tests"
135135

136136
message <<-MARKDOWN
137-
Capybara is a common framework used to write integration tests in Rails. It integrates nicely with RSpec such that you can use the same kind of test language to write integration tests.
138-
137+
Capybara is a common framework used to write integration tests in Rails. It integrates nicely with RSpec such that you can use the same kind of test language to write integration tests.
138+
139139
As an added bonus for this section, write an integration test :)
140-
140+
141141
Use the following link to get started: https://www.sitepoint.com/basics-capybara-improving-tests/
142142

143143
MARKDOWN

0 commit comments

Comments
 (0)