require File.join(__FILE__.gsub(/(.*)?\/spec\/.*$/, '\1'), 'spec/spec_helper') describe Rtml::ReverseEngineering::Crawler do context "with a prefab TML document" do before :each do subject.tml = File.read(File.join(Rtml.root, "spec/support/raw_tml/valid_document.tml")) end it "should visit #init and then #main" do subject.visit "#init" subject.current_screen.should == "main" end end context "with a missing action" do before :each do subject.visit "/rtml/missing_action.rtml?ignore_state=true" #"/rtml-2.0.0/missing_action.tml?ignore_state=true" end it "should pause at #rescue" do subject.current_screen.should == "rescue" end end end