class TestActWebService

Public Instance Methods

test_e_words() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 299
def test_e_words
  ok_wi([:script, {:src=>'http://e-words.jp/embed.x',
            :type=>'text/javascript'}, ''], '{{e_words}}')
end
test_google_ad() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 304
def test_google_ad
  t_add_user
  page = @site.create_new
  page.store('{{google_ad}}')
  res = session('/test/1.html')
  ok_wi(/pagead2.googlesyndication.com/, '{{google_ad}}')
end
test_plg_hatena_point() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 230
    def test_plg_hatena_point
      t_add_user
      page = @site.create_new
      page.store('{{hatena_point(a)}}')
      res = session('/test/1.html')
      span = res.body.get_path("//span[@class='hatena_point']")
      rdf = span[2]
      ok_eq([:'rdf:RDF',
              {:'xmlns:rdf'=>'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
                :'xmlns:foaf'=>'http://xmlns.com/foaf/0.1/'},
              [:'rdf:Description',
                {:'rdf:about'=>'http://example.com/test/1.html'},
                [:'foaf:maker',
                  {:'rdf:parseType'=>'Resource'},
                  [:'foaf:holdsAccount',
                    [:'foaf:OnlineAccount',
                      {:'foaf:accountName'=>'a'},
                      [:'foaf:accountServiceHomepage',
                        {:'rdf:resource'=>'http://www.hatena.ne.jp/'}]]]]]],
            rdf)

=begin
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:foaf='http://xmlns.com/foaf/0.1/'>
<rdf:Description 
 rdf:about="エントリーのPermalink あるいはウェブサイトのURL">
 <foaf:maker rdf:parseType='Resource'>
 <foaf:holdsAccount>
 <foaf:OnlineAccount 
 foaf:accountName="あなたのはてなアカウント名">
 <foaf:accountServiceHomepage 
         rdf:resource='http://www.hatena.ne.jp/' />
 </foaf:OnlineAccount>
 </foaf:holdsAccount>
 </foaf:maker>
</rdf:Description>
</rdf:RDF>
=end
      str = rdf.rb_format_xml
      #puts str

      ok_eq(
"<rdf:RDF xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
><rdf:Description rdf:about=\"http://example.com/test/1.html\"
><foaf:maker rdf:parseType=\"Resource\"
><foaf:holdsAccount
><foaf:OnlineAccount foaf:accountName=\"a\"
><foaf:accountServiceHomepage rdf:resource=\"http://www.hatena.ne.jp/\"
/></foaf:OnlineAccount
></foaf:holdsAccount
></foaf:maker
></rdf:Description
></rdf:RDF
>",
            str)
    end
test_sub_bloglines() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 293
def test_sub_bloglines
  ok_wi([:a, {:href=>'http://www.bloglines.com/sub/http://example.com/test/'}, [:img, {:src=>'http://www.bloglines.com/images/sub_modern4.gif', :border=>'0', :alt=>'subscribe Bloglines'}]], '{{sub_bloglines}}')
  ok_wi([:a, {:href=>'http://www.bloglines.com/sub/http://e.com/'}, [:img, {:src=>'http://www.bloglines.com/images/sub_modern4.gif', :border=>'0', :alt=>'subscribe Bloglines'}]], '{{sub_bloglines(http://e.com/)}}')
  ok_wi([:a, {:href=>'http://www.bloglines.com/sub/http://e.com/'}, [:img, {:src=>'http://www.bloglines.com/images/sub_modern3.gif', :border=>'0', :alt=>'subscribe Bloglines'}]], '{{sub_bloglines(http://e.com/,modern3)}}')
end
test_trackfeed() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 288
def test_trackfeed
  ok_wi([:script, {:src=>'http://trackfeed.com/usr/1.js'}, ''],
        '{{trackfeed(1)}}')
end
test_translate() click to toggle source
# File vendor/qwik/lib/qwik/act-webservice.rb, line 312
def test_translate
  ok_wi([:a, {:href=>'http://www.excite.co.jp/world/english/web/proceeding/?wb_lp=JAEN&wb_url=http://example.com/test/1.html'}, 'translate (j->e)'],
        '{{translate_je}}')
  ok_wi([:a, {:href=>'http://www.excite.co.jp/world/english/web/proceeding/?wb_lp=JAEN&wb_url=http://example.com/test/1.html'}, 'English'],
        '{{translate_je(English)}}')
  ok_wi([:a, {:href=>'http://www.excite.co.jp/world/english/web/proceeding/?wb_lp=ENJA&wb_url=http://example.com/test/1.html'}, 'translate (e->j)'],
        '{{translate_ej}}')
end