Skip to content

Commit aaa4fc8

Browse files
committed
add (failing) tests
plus db, or the tests will complain
1 parent 75eca79 commit aaa4fc8

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

db/schema.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is auto-generated from the current state of the database. Instead
2+
# of editing this file, please use the migrations feature of Active Record to
3+
# incrementally modify your database, and then regenerate this schema definition.
4+
#
5+
# This file is the source Rails uses to define your schema when running `rails
6+
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7+
# be faster and is potentially less error prone than running all of your
8+
# migrations from scratch. Old migrations may fail to apply correctly if those
9+
# migrations use external dependencies or application code.
10+
#
11+
# It's strongly recommended that you check this file into your version control system.
12+
13+
ActiveRecord::Schema.define(version: 0) do
14+
15+
end

test/controllers/pages_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class PagesControllerTest < ActionDispatch::IntegrationTest
44
test "should get home" do
5-
get pages_home_url
5+
get root_path
66
assert_response :success
77
end
88

test/system/pages_test.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require "application_system_test_case"
2+
3+
class PagesTest < ApplicationSystemTestCase
4+
test "visiting the home page" do
5+
visit root_path
6+
7+
assert_selector "h1", text: "Hamburger Toggler"
8+
end
9+
10+
test 'clicking the hamburger/nav' do
11+
visit root_path
12+
click_button "🍔"
13+
assert_selector "nav", class: 'active'
14+
end
15+
16+
test 'clicking a second toggler' do
17+
visit root_path
18+
# second button
19+
end
20+
end

0 commit comments

Comments
 (0)