Sha256: c4dcc8027b2469a03baa83f89d131c7e4e2f1a63f547c2e6256d279bb75dc4ba

Contents?: true

Size: 1.97 KB

Versions: 18

Compression:

Stored size: 1.97 KB

Contents

describe "URI" do

    before(:all) do
        @@file_name = File.join(Rho::RhoApplication::get_base_app_path(), 'local_file.txt')
        unless File.exists?(@@file_name)
            write_data  = "this is rhodes test"
            f = File.new(@@file_name, "w")
            f.write(write_data)
            f.close        
        end
    end

    after(:all) do
        File.delete(@@file_name) if File.exists?(@@file_name)
    end

    it "test navigate local page" do
        WebView.navigate "/app"
    end

    it "test navigate external http" do
        WebView.navigate "http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg?rho_open_target=_blanck"
    end

    it "test navigate local file" do
        puts "runnuni open local file: #{@@file_name}"
        WebView.navigate "file://" + @@file_name
    end

    it "test navigate phone uri" do
        WebView.navigate "tel:1234567"
    end

    it "test navigate sms uri" do
        WebView.navigate "sms:+1234567?body=test%20sms%20message"
    end

    it "test navigate mailto URI" do
        WebView.navigate "mailto:dev@rhomobile.com?body=test%20phone%20spec%20mail%20message"
    end

    it "test navigate video" do
        WebView.navigate "video.avi"
    end

    it "test open local page" do
        WebView.navigate "/app"
    end

    it "test open external http" do
        WebView.navigate "http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg?rho_open_target=_blanck"
    end

    it "test open local file" do
        puts "runnuni open local file: #{@@file_name}"
        System.open_url "file://" + @@file_name
    end

    it "test open phone uri" do
        System.open_url "tel:1234567"
    end

    it "test open sms uri" do
        System.open_url "sms:+1234567?body=test%20sms%20message"
    end

    it "test open mailto URI" do
        System.open_url "mailto:dev@rhomobile.com?body=test%20phone%20spec%20mail%20message"
    end

    it "test open video" do
        System.open_url "video.avi"
    end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.1.beta spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0.beta.5 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0.beta.4 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0.beta.3 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0.beta.2 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.1.0.beta.1 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.2 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.2.beta.1 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.8 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.7 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.6 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.5 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.4 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.3 spec/phone_spec/app/spec/uri_spec.rb
rhodes-3.0.1.beta.2 spec/phone_spec/app/spec/uri_spec.rb