0

I've tried p page and p page.source and also:

(rdb:1) find ('page')
(rdb:1) find ('bosy')
(rdb:1) find ('body')
(rdb:1) find
(rdb:1) p page
(rdb:1) p html
(rdb:1) p source
(rdb:1) p page.source

but all I get is variations on:

*** Unknown command: "page".  Try "help".

Code:

describe "For a user who is not logged in." do

  context "Visiting the home page." do
    before(:each) { visit root_path }

    describe "The page." do
      subject { page }

      debugger
      1   

      it "Has a 'login' link." do
        should have_link('Sign In')
      end 

      it "does NOT have a 'logout' link." do
        should have_no_link('Logout')
      end 

    end 

  end

end
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

2 Answers2

1

Where your current debugger line is won't get executed in the scope where page is defined. Maybe before(:each) { visit root_path; debugger } would work. Completely untested.

Wizard of Ogz
  • 12,543
  • 2
  • 41
  • 43
1

Hm. I can't answer your question, but if you goal is to peek at the page, you could use

save_and_open_page

which requires the launchy gem in test & development scope.

(assuming you're using capybara?)

bento
  • 2,079
  • 1
  • 16
  • 13