describe "ProMotion::TestWebScreen functionality" do extend WebStub::SpecHelpers before { disable_network_access! } after { enable_network_access! } tests PM::TestWebScreen # Override controller to properly instantiate def controller rotate_device to: :portrait, button: :bottom @webscreen ||= TestWebScreen.new(nav_bar: true) @webscreen.navigation_controller end after do @webscreen = nil end it "should have the proper html content" do file_name = "WebScreen.html" @webscreen.set_content(file_name) @loaded_file = File.read(File.join(NSBundle.mainBundle.resourcePath, file_name)) wait_for_change @webscreen, 'load_finished' do @webscreen.html.delete("\n").should == @loaded_file.delete("\n") end end it "should allow you to navigate to a website" do stub_request(:get, "https://www.google.com/"). to_return(body: %q{Google!