From 0d41c9c5f3b4e7a451c603385305fb17779e813f Mon Sep 17 00:00:00 2001 From: Daniel Grippi <danielgrippi@Daniels-MacBook-Pro.local> Date: Mon, 5 Dec 2011 19:52:17 -0800 Subject: [PATCH] update gems -- mainly omniauth (we explicitly include omniauth libs now... much cleaner) --- Gemfile | 19 +- Gemfile.lock | 180 +++++++----------- features/api.feature | 4 +- features/step_definitions/aspects_steps.rb | 8 +- .../step_definitions/conversations_steps.rb | 30 +-- features/step_definitions/custom_web_steps.rb | 18 +- features/step_definitions/factory_steps.rb | 2 +- features/step_definitions/lightbox_steps.rb | 14 +- features/step_definitions/oauth_steps.rb | 26 +-- features/step_definitions/scope_steps.rb | 8 +- features/step_definitions/session_steps.rb | 32 ++-- features/step_definitions/uri-step.rb | 22 +-- features/step_definitions/user_steps.rb | 2 +- features/step_definitions/web_steps.rb | 3 +- public/index.html | 2 +- spec/lib/webfinger_spec.rb | 16 +- spec/models/services/twitter_spec.rb | 2 +- 17 files changed, 178 insertions(+), 210 deletions(-) diff --git a/Gemfile b/Gemfile index 06491e6fa8..8a76fedbe6 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'rails', '3.0.11' gem 'bundler', '>= 1.0.0' gem 'foreman' -gem 'thin', '1.2.11', :require => false +gem 'thin', '~> 1.3.1', :require => false # authentication @@ -13,8 +13,13 @@ gem 'devise', '~> 1.3.1' gem 'devise_invitable', '0.5.0' gem 'jwt', "0.1.3" gem 'oauth2-provider', '0.0.16' -gem 'omniauth', '0.2.6' -gem 'twitter', '1.5.0' + +gem 'omniauth', '1.0.1' +gem 'omniauth-facebook' +gem 'omniauth-tumblr' +gem 'omniauth-twitter' + +gem 'twitter', '2.0.1' # backups @@ -93,7 +98,7 @@ gem 'http_accept_language', :git => 'git://github.com/iain/http_accept_language. # views -gem 'haml', '3.1.2' +gem 'haml', '3.1.4' gem 'mobile-fu' gem 'sass', '3.1.7' gem 'will_paginate', '3.0.pre2' @@ -118,19 +123,19 @@ end group :test do gem 'capybara', '~> 0.3.9' gem 'cucumber-rails', '0.3.2' - gem 'cucumber-api-steps', :require => false + gem 'cucumber-api-steps', '0.6', :require => false gem 'database_cleaner', '0.6.0' gem 'diaspora-client', :git => 'git://github.com/diaspora/diaspora-client.git' #"0.1.0", #:path => '~/workspace/diaspora-client' gem 'factory_girl_rails' gem 'fixture_builder', '0.3.0' - gem 'fuubar' + gem 'fuubar', '0.0.5' gem 'mongrel', :require => false, :platforms => :ruby_18 gem 'rspec', '>= 2.0.0' gem 'rspec-core', '2.6.0' gem 'rspec-instafail', '>= 0.1.7', :require => false gem 'rspec-rails', '>= 2.0.0' - gem "selenium-webdriver", "~> 2.10.0" + gem 'selenium-webdriver', '~> 2.14.0' gem 'webmock', :require => false gem 'sqlite3' gem 'mock_redis' diff --git a/Gemfile.lock b/Gemfile.lock index 9fb553ec37..45343ed6ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ GIT GIT remote: git://github.com/MikeSofaer/sod.git - revision: 08e990601bfa6ffd3224a2e4c792df9eae712693 + revision: e7fb74b412ec9dcd6b18f29c2accca6375cacdcf specs: sod (0.0.1) net-scp @@ -31,13 +31,13 @@ GIT GIT remote: git://github.com/diaspora/diaspora-client.git - revision: a1b6c480fa3caa8ce24912dda471579de842aa51 + revision: 04fffe5d8eebc11653716e501de755c51f5cd884 specs: - diaspora-client (0.1.1) + diaspora-client (0.1.2) activerecord faraday jwt (>= 0.1.3) - oauth2 (= 0.4.1) + oauth2 (= 0.5.0) sinatra GIT @@ -129,18 +129,18 @@ GEM ohai (>= 0.5.7) rest-client (>= 1.0.4, < 1.7.0) uuidtools - childprocess (0.2.2) + childprocess (0.2.3) ffi (~> 1.0.6) - client_side_validations (3.1.0) + client_side_validations (3.1.3) closure-compiler (1.1.4) cloudfiles (1.4.10) mime-types (>= 1.16) - columnize (0.3.4) + columnize (0.3.5) crack (0.3.1) - cucumber (1.1.0) + cucumber (1.1.3) builder (>= 2.1.2) diff-lcs (>= 1.1.2) - gherkin (~> 2.5.0) + gherkin (~> 2.6.7) json (>= 1.4.6) term-ansicolor (>= 1.0.6) cucumber-api-steps (0.6) @@ -169,22 +169,20 @@ GEM eventmachine (0.12.10) excon (0.2.4) extlib (0.9.15) - factory_girl (2.1.2) + factory_girl (2.3.2) activesupport - factory_girl_rails (1.2.0) - factory_girl (~> 2.1.0) + factory_girl_rails (1.4.0) + factory_girl (~> 2.3.0) railties (>= 3.0.0) - faraday (0.6.1) + faraday (0.7.0) addressable (~> 2.2.4) multipart-post (~> 1.1.0) rack (>= 1.1.0, < 2) faraday-stack (0.1.3) faraday (~> 0.6) - faraday_middleware (0.6.5) - faraday (~> 0.6.0) fastercsv (1.5.4) fastthread (1.0.7) - ffi (1.0.9) + ffi (1.0.11) fixture_builder (0.3.0) activerecord (>= 2) activesupport (>= 2) @@ -198,20 +196,20 @@ GEM nokogiri (~> 1.4.3.1) ruby-hmac foreigner (0.9.1) - foreman (0.24.0) + foreman (0.27.0) term-ansicolor (~> 1.0.5) thor (>= 0.13.6) formatador (0.2.1) - fuubar (0.0.6) + fuubar (0.0.5) rspec (~> 2.0) - rspec-instafail (~> 0.1.8) + rspec-instafail (~> 0.1.4) ruby-progressbar (~> 0.0.10) gem_plugin (0.2.3) - gherkin (2.5.2) + gherkin (2.6.9) json (>= 1.4.6) - haml (3.1.2) - hashie (1.0.0) - highline (1.6.2) + haml (3.1.4) + hashie (1.2.0) + highline (1.6.8) hoptoad_notifier (2.4.11) activesupport builder @@ -231,9 +229,8 @@ GEM rack (>= 1.1) rspec (>= 1.3.1) selenium-webdriver (>= 0.1.3) - jasmine-core (1.2.0.rc1) + jasmine-core (1.1.0) json (1.4.6) - json_pure (1.6.1) jsonpath (0.4.2) multi_json jwt (0.1.3) @@ -265,11 +262,9 @@ GEM daemons (>= 1.0.3) fastthread (>= 1.0.1) gem_plugin (>= 0.2.3) - multi_json (1.0.3) - multi_xml (0.2.2) - multipart-post (1.1.3) + multi_json (1.0.4) + multipart-post (1.1.4) mysql2 (0.2.13) - net-ldap (0.2.2) net-scp (1.0.4) net-ssh (>= 1.99.1) net-sftp (2.0.5) @@ -279,36 +274,10 @@ GEM net-ssh (>= 1.99.1) newrelic_rpm (3.3.0) nokogiri (1.4.3.1) - oa-basic (0.2.6) - oa-core (= 0.2.6) - rest-client (~> 1.6.0) - oa-core (0.2.6) - oa-enterprise (0.2.6) - addressable (= 2.2.4) - net-ldap (~> 0.2.2) - nokogiri (~> 1.4.2) - oa-core (= 0.2.6) - pyu-ruby-sasl (~> 0.0.3.1) - rubyntlm (~> 0.1.1) - oa-more (0.2.6) - multi_json (~> 1.0.0) - oa-core (= 0.2.6) - rest-client (~> 1.6.0) - oa-oauth (0.2.6) - faraday (~> 0.6.1) - multi_json (~> 1.0.0) - multi_xml (~> 0.2.2) - oa-core (= 0.2.6) - oauth (~> 0.4.0) - oauth2 (~> 0.4.1) - oa-openid (0.2.6) - oa-core (= 0.2.6) - rack-openid (~> 1.3.1) - ruby-openid-apps-discovery (~> 1.2.0) oauth (0.4.5) - oauth2 (0.4.1) - faraday (~> 0.6.1) - multi_json (>= 0.0.5) + oauth2 (0.5.0) + faraday (>= 0.6.1, < 0.8) + multi_json (~> 1.0.0) oauth2-provider (0.0.16) activesupport (~> 3.0.1) addressable (~> 2.2) @@ -319,28 +288,32 @@ GEM mixlib-config mixlib-log systemu - omniauth (0.2.6) - oa-basic (= 0.2.6) - oa-core (= 0.2.6) - oa-enterprise (= 0.2.6) - oa-more (= 0.2.6) - oa-oauth (= 0.2.6) - oa-openid (= 0.2.6) - open4 (1.2.0) + omniauth (1.0.1) + hashie (~> 1.2) + rack + omniauth-facebook (1.0.0) + omniauth-oauth2 (~> 1.0.0) + omniauth-oauth (1.0.0) + oauth + omniauth (~> 1.0) + omniauth-oauth2 (1.0.0) + oauth2 (~> 0.5.0) + omniauth (~> 1.0) + omniauth-tumblr (1.0) + omniauth-oauth (~> 1.0) + omniauth-twitter (0.0.7) + omniauth-oauth (~> 1.0) + open4 (1.3.0) orm_adapter (0.0.5) parallel (0.5.9) - parallel_tests (0.6.7) + parallel_tests (0.6.11) parallel polyglot (0.3.3) - pyu-ruby-sasl (0.0.3.3) rack (1.2.4) rack-mobile-detect (0.3.0) rack rack-mount (0.6.14) rack (>= 1.0.0) - rack-openid (1.3.1) - rack (>= 1.1.0) - ruby-openid (>= 2.1.8) rack-test (0.5.7) rack (>= 1.0) rails (3.0.11) @@ -351,7 +324,7 @@ GEM activesupport (= 3.0.11) bundler (~> 1.0) railties (= 3.0.11) - rails-i18n (0.1.11) + rails-i18n (0.2.0) i18n (~> 0.5) railties (3.0.11) actionpack (= 3.0.11) @@ -360,8 +333,6 @@ GEM rdoc (~> 3.4) thor (~> 0.14.4) rake (0.9.2.2) - rash (0.3.0) - hashie (~> 1.0.0) rdoc (3.11) json (~> 1.4) redcarpet (2.0.0b5) @@ -373,9 +344,9 @@ GEM redis-namespace (~> 0.8.0) sinatra (>= 0.9.2) vegas (~> 0.1.2) - resque-ensure-connected (0.1.0) + resque-ensure-connected (0.2.0) activerecord (>= 2.3.5) - resque (~> 1.10.0) + resque (>= 1.10.0) resque-timeout (1.0.0) resque (~> 1.0) rest-client (1.6.1) @@ -387,7 +358,7 @@ GEM rspec-core (2.6.0) rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) - rspec-instafail (0.1.8) + rspec-instafail (0.1.9) rspec-mocks (2.6.0) rspec-rails (2.6.1) actionpack (~> 3.0) @@ -408,31 +379,27 @@ GEM linecache19 (>= 0.5.11) ruby-debug-base19 (>= 0.11.19) ruby-hmac (0.4.0) - ruby-oembed (0.8.3) - ruby-openid (2.1.8) - ruby-openid-apps-discovery (1.2.0) - ruby-openid (>= 2.1.7) + ruby-oembed (0.8.5) ruby-progressbar (0.0.10) ruby_core_source (0.1.5) archive-tar-minitar (>= 0.5.2) - rubyntlm (0.1.1) - rubyzip (0.9.4) + rubyzip (0.9.5) sass (3.1.7) - selenium-webdriver (2.10.0) + selenium-webdriver (2.14.0) childprocess (>= 0.2.1) - ffi (= 1.0.9) - json_pure + ffi (~> 1.0.9) + multi_json (~> 1.0.4) rubyzip settingslogic (2.0.6) simple_oauth (0.1.5) sinatra (1.2.7) rack (~> 1.1) tilt (>= 1.2.2, < 2.0) - sqlite3 (1.3.4) + sqlite3 (1.3.5) subexec (0.0.4) - systemu (2.4.0) + systemu (2.4.1) term-ansicolor (1.0.7) - thin (1.2.11) + thin (1.3.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) @@ -441,16 +408,12 @@ GEM treetop (1.4.10) polyglot polyglot (>= 0.3.1) - twitter (1.5.0) - faraday (~> 0.6.1) - faraday_middleware (~> 0.6.3) - hashie (~> 1.0.0) - multi_json (~> 1.0.0) - multi_xml (~> 0.2.0) - rash (~> 0.3.0) - simple_oauth (~> 0.1.5) - typhoeus (0.2.4) - mime-types + twitter (2.0.1) + activesupport (>= 2.3.9, < 4) + faraday (~> 0.7) + multi_json (~> 1.0) + simple_oauth (~> 0.1) + typhoeus (0.3.3) mime-types tzinfo (0.3.31) uuidtools (2.1.2) @@ -463,7 +426,7 @@ GEM crack (>= 0.1.7) will_paginate (3.0.pre2) xml-simple (1.1.1) - yard (0.7.2) + yard (0.7.4) yui-compressor (0.9.6) POpen4 (>= 0.1.4) @@ -485,7 +448,7 @@ DEPENDENCIES chef (= 0.9.12) client_side_validations cloudfiles (= 1.4.10) - cucumber-api-steps + cucumber-api-steps (= 0.6) cucumber-rails (= 0.3.2) database_cleaner (= 0.6.0) devise (~> 1.3.1) @@ -502,8 +465,8 @@ DEPENDENCIES fog (= 0.3.25) foreigner (= 0.9.1) foreman - fuubar - haml (= 3.1.2) + fuubar (= 0.0.5) + haml (= 3.1.4) hoptoad_notifier http_accept_language! i18n-inflector-rails (~> 1.0) @@ -522,7 +485,10 @@ DEPENDENCIES nokogiri oauth2-provider (= 0.0.16) ohai (= 0.5.8) - omniauth (= 0.2.6) + omniauth (= 1.0.1) + omniauth-facebook + omniauth-tumblr + omniauth-twitter parallel_tests rails (= 3.0.11) rails-i18n @@ -540,12 +506,12 @@ DEPENDENCIES ruby-debug19 ruby-oembed sass (= 3.1.7) - selenium-webdriver (~> 2.10.0) + selenium-webdriver (~> 2.14.0) settingslogic (= 2.0.6) sod! sqlite3 - thin (= 1.2.11) - twitter (= 1.5.0) + thin (~> 1.3.1) + twitter (= 2.0.1) typhoeus vanna! webmock diff --git a/features/api.feature b/features/api.feature index b051c72d37..423b425ee6 100644 --- a/features/api.feature +++ b/features/api.feature @@ -3,9 +3,9 @@ Feature: API as an epic developer I need to get user's info - Scenario: Getting a users public profile + Scenario: Getting a users public profile Given a user named "Maxwell S" with email "maxwell@example.com" And I send and accept JSON - When I send a GET request to "/api/v0/users/maxwell_s" + When I send a GET request for "/api/v0/users/maxwell_s" Then the response status should be "200" And the JSON response should have "first_name" with the text "Maxwell" diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index 50cb39429d..d09ea99f63 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -1,5 +1,5 @@ When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name| - When %{I hover over the "ul.sub_nav > li:contains('#{aspect_name}')"} + step %{I hover over the "ul.sub_nav > li:contains('#{aspect_name}')"} within("#aspect_nav") do find(:xpath, "//a[@rel='facebox'][.//img[@title='Edit #{aspect_name}']]").click end @@ -10,19 +10,19 @@ When /^I select only "([^"]*)" aspect$/ do |aspect_name| click_link 'Select all' if has_link? 'Select all' end - And %{I wait for the ajax to finish} + step %{I wait for the ajax to finish} within('#aspect_nav') do click_link 'Deselect all' if has_link? 'Deselect all' end - And %{I wait for the ajax to finish} + step %{I wait for the ajax to finish} within('#aspect_nav') do click_link aspect_name end - And %{I wait for the ajax to finish} + step %{I wait for the ajax to finish} end When /^I should see "([^"]*)" aspect selected$/ do |aspect_name| diff --git a/features/step_definitions/conversations_steps.rb b/features/step_definitions/conversations_steps.rb index 7d3c09ffdd..d3b623cb49 100644 --- a/features/step_definitions/conversations_steps.rb +++ b/features/step_definitions/conversations_steps.rb @@ -5,22 +5,22 @@ Then /^"([^"]*)" should be part of active conversation$/ do |name| end Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person| - Given %(I am on the conversations page) - And %(I follow "New Message") - And %(I wait for the ajax to finish) - And %(I fill in "contact_autocomplete" with "#{person}" in the modal window) - And %(I press the first ".as-result-item" within ".as-results" in the modal window) - And %(I fill in "conversation_subject" with "#{subject}" in the modal window) - And %(I fill in "conversation_text" with "#{text}" in the modal window) - And %(I press "Send" in the modal window) - And %(I wait for the ajax to finish) + step %(I am on the conversations page) + step %(I follow "New Message") + step %(I wait for the ajax to finish) + step %(I fill in "contact_autocomplete" with "#{person}" in the modal window) + step %(I press the first ".as-result-item" within ".as-results" in the modal window) + step %(I fill in "conversation_subject" with "#{subject}" in the modal window) + step %(I fill in "conversation_text" with "#{text}" in the modal window) + step %(I press "Send" in the modal window) + step %(I wait for the ajax to finish) end When /^I reply with "([^"]*)"$/ do |text| - When %(I am on the conversations page) - And %(I press the first ".conversation" within ".conversations") - And %(I wait for the ajax to finish) - And %(I fill in "message_text" with "#{text}") - And %(I press "Reply") - And %(I wait for the ajax to finish) + step %(I am on the conversations page) + step %(I press the first ".conversation" within ".conversations") + step %(I wait for the ajax to finish) + step %(I fill in "message_text" with "#{text}") + step %(I press "Reply") + step %(I wait for the ajax to finish) end diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 2a09586c46..f1e0a73ca9 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -1,6 +1,6 @@ When /^(.*) in the header$/ do |action| within('header') do - When action + step action end end @@ -25,11 +25,11 @@ And /^I toggle the aspect "([^"]*)"$/ do |aspect_name| end Then /^the publisher should be collapsed$/ do - find("#publisher")["class"].should include("closed") + find("#publisher")["class"].should include("closed") end Then /^the publisher should be expanded$/ do - find("#publisher")["class"].should_not include("closed") + find("#publisher")["class"].should_not include("closed") end When /^I append "([^"]*)" to the publisher$/ do |stuff| @@ -91,7 +91,7 @@ end When /^(.*) in the modal window$/ do |action| within('#facebox') do - When action + step action end end @@ -133,9 +133,9 @@ When /^I attach the file "([^\"]*)" to hidden element "([^\"]*)"(?: within "([^\ JS if selector - When "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\" within \"#{selector}\"" + step "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\" within \"#{selector}\"" else - When "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\"" + step "I attach the file \"#{Rails.root.join(path).to_s}\" to \"#{field}\"" end page.execute_script <<-JS @@ -148,7 +148,7 @@ Then /^I should get download alert$/ do end When /^I search for "([^\"]*)"$/ do |search_term| - When "I fill in \"q\" with \"#{search_term}\"" + step "I fill in \"q\" with \"#{search_term}\"" page.execute_script <<-JS var e = jQuery.Event("keypress"); e.keyCode = 13; @@ -197,11 +197,11 @@ end Then /^I follow Edit Profile in the same window$/ do page.execute_script("$('a[href=\"#{edit_profile_path}\"]').removeAttr('target')") - And %(I follow "Edit Profile") + step %(I follow "Edit Profile") end Then 'I should see an image attached to the post' do - Then %{I should see a "img" within ".stream_element div.photo_attachments"} + step %{I should see a "img" within ".stream_element div.photo_attachments"} end Then 'I press the attached image' do diff --git a/features/step_definitions/factory_steps.rb b/features/step_definitions/factory_steps.rb index cf1495e999..15e406e789 100644 --- a/features/step_definitions/factory_steps.rb +++ b/features/step_definitions/factory_steps.rb @@ -37,7 +37,7 @@ Given %r{^I have a (.+)$} do |model_name| end Given %r{^I have the following (.+):$} do |child, table| - Given "that me has the following #{child}:", table + step "that me has the following #{child}:", table end Given %r{^the following (.+):$} do |model_name, table| diff --git a/features/step_definitions/lightbox_steps.rb b/features/step_definitions/lightbox_steps.rb index 33497302ff..6c9fe81e7e 100644 --- a/features/step_definitions/lightbox_steps.rb +++ b/features/step_definitions/lightbox_steps.rb @@ -1,13 +1,13 @@ Then 'I should see the photo lightbox' do - Then %{I should see a "img" within "#lightbox-imageset"} - And %{I should see a "#lightbox-backdrop" within "body"} - And %{I should see a "#lightbox-image" within "body"} + step %{I should see a "img" within "#lightbox-imageset"} + step %{I should see a "#lightbox-backdrop" within "body"} + step %{I should see a "#lightbox-image" within "body"} end Then 'I should not see the photo lightbox' do - Then %{I should not see a "img" within "#lightbox-imageset"} - And %{I should not see a "#lightbox-backdrop" within "body"} - And %{I should not see a "#lightbox-image" within "body"} + step %{I should not see a "img" within "#lightbox-imageset"} + step %{I should not see a "#lightbox-backdrop" within "body"} + step %{I should not see a "#lightbox-image" within "body"} end Then 'I press the close lightbox link' do @@ -16,4 +16,4 @@ end Then 'I press the lightbox backdrop' do find(:css, "#lightbox-backdrop").click -end \ No newline at end of file +end diff --git a/features/step_definitions/oauth_steps.rb b/features/step_definitions/oauth_steps.rb index c1f0705fd7..f58599e17e 100644 --- a/features/step_definitions/oauth_steps.rb +++ b/features/step_definitions/oauth_steps.rb @@ -33,26 +33,26 @@ end When /^I try to authorize Chubbies$/ do # We need to reset the tokens saved in Chubbies, # as we are clearing the Diaspora DB every scenario - Then 'I visit "/new" on Chubbies' + step 'I visit "/new" on Chubbies' ### - And "I fill in my Diaspora ID to connect" - And 'I press "Connect to Diaspora"' - Then 'I should be on the new user session page' - And "I fill in \"Username\" with \"#{@me.username}\"" - And "I fill in \"Password\" with \"#{@me.password}\"" - And 'I press "Sign in"' - Then 'I should be on the oauth authorize page' - Then 'I should see "Chubbies"' - And 'I should see "The best way to chub."' + step "I fill in my Diaspora ID to connect" + step 'I press "Connect to Diaspora"' + step 'I should be on the new user session page' + step "I fill in \"Username\" with \"#{@me.username}\"" + step "I fill in \"Password\" with \"#{@me.password}\"" + step 'I press "Sign in"' + step 'I should be on the oauth authorize page' + step 'I should see "Chubbies"' + step 'I should see "The best way to chub."' end And /^I fill in my Diaspora ID to connect$/ do - And "I fill in \"Diaspora ID\" with \"#{@me.diaspora_handle}\"" + step "I fill in \"Diaspora ID\" with \"#{@me.diaspora_handle}\"" end And /^I should have (\d) user on Chubbies$/ do |num| - When "I visit \"/user_count\" on Chubbies" - Then "I should see \"#{num}\"" + step "I visit \"/user_count\" on Chubbies" + step "I should see \"#{num}\"" end When /^I visit "([^"]+)" on Chubbies$/ do |path| diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb index 43fe2f48a9..588f62ca67 100644 --- a/features/step_definitions/scope_steps.rb +++ b/features/step_definitions/scope_steps.rb @@ -1,10 +1,8 @@ module SectionLocator - def within_parent(content, elements = ['*'], &block) expr = %(//*[(#{elements.join('|')})/descendant-or-self::*[contains(., "#{content}")]]) within(expr, &block) end - end World(SectionLocator) @@ -13,18 +11,18 @@ sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong header) When /^(.*) in the "([^\"]*)" section$/ do |action, title| within_parent(title, sections) do - When action + step action end end When /^(.*) in the "([^\"]*)" section:$/ do |action, title, table| within_parent(title, sections) do - When "#{action}:", table + step "#{action}:", table end end When /^(.*) in the "([^\"]*)" row$/ do |action, title| within_parent(title, %w(th td)) do - When action + step action end end diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index 60108fa91a..8082793892 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -1,43 +1,43 @@ Given /^(?:I am signed in|I sign in)$/ do - When %(I try to sign in) + step %(I try to sign in) wait_until { page.has_content?("#{@me.first_name} #{@me.last_name}") } end When /^I try to sign in$/ do @me ||= Factory(:user_with_aspect, :getting_started => false) page.driver.visit(new_integration_sessions_path(:user_id => @me.id)) - And %(I press "Login") - And %(I am on the homepage) + step %(I press "Login") + step %(I am on the homepage) # To save time as compared to: - #When %(I go to the new user session page) - #When %(I fill in "Username" with "#{@me.username}") - #When %(I fill in "Password" with "#{@me.password}") - #When %(I press "Sign in") + #step %(I go to the new user session page) + #step %(I fill in "Username" with "#{@me.username}") + #step %(I fill in "Password" with "#{@me.password}") + #step %(I press "Sign in") end When /^I try to sign in manually$/ do - When %(I go to the new user session page) - When %(I fill in "Username" with "#{@me.username}") - When %(I fill in "Password" with "#{@me.password}") - When %(I press "Sign in") + step %(I go to the new user session page) + step %(I fill in "Username" with "#{@me.username}") + step %(I fill in "Password" with "#{@me.password}") + step %(I press "Sign in") end When /^I sign in as "([^"]*)"$/ do |email| @me = User.find_by_email(email) @me.password ||= 'password' - Given 'I am signed in' + step 'I am signed in' end When /^I sign in with password "([^"]*)"$/ do |password| @me.password = password - Given 'I am signed in' + step 'I am signed in' end When /^I put in my password in "([^"]*)"$/ do |field| - When %(I fill in "#{field}" with "#{@me.password}") + step %(I fill in "#{field}" with "#{@me.password}") end When /^I (?:log|sign) out$/ do - When 'I click on my name in the header' - And 'I follow "Log out"' + step 'I click on my name in the header' + step 'I follow "Log out"' end diff --git a/features/step_definitions/uri-step.rb b/features/step_definitions/uri-step.rb index 02aa4064ec..ad13ed7c48 100644 --- a/features/step_definitions/uri-step.rb +++ b/features/step_definitions/uri-step.rb @@ -1,30 +1,30 @@ Given /^configuration parameter (\w+) is ([^ ]+)$/ do |key, value| - require Rails.root.join('config', "initializers", "_load_app_config.rb") - app_value = AppConfig[ key.to_sym] - assert_equal value, app_value, - "You must set #{key} to #{value} and kill running server" + require Rails.root.join('config', "initializers", "_load_app_config.rb") + app_value = AppConfig[ key.to_sym] + assert_equal value, app_value, + "You must set #{key} to #{value} and kill running server" end When /^I visit url ([^ ]+)$/ do |url| - visit( url) + visit( url) end Then /^I should find '([^']*)' in ([^ ]+)$/ do |pattern,file| - found = %x!fgrep -o #{pattern} #{file}! - assert_equal pattern, found.chomp, "Can't find pattern in #{file}" + found = %x!fgrep -o #{pattern} #{file}! + assert_equal pattern, found.chomp, "Can't find pattern in #{file}" end Then /^I should match '([^']*)' in ([^ ]+)$/ do |pattern,file| - found = `egrep -o '#{pattern}' #{file}` - assert_match /#{pattern}/, found.chomp, "Can't find #{pattern} in #{file}" + found = `egrep -o '#{pattern}' #{file}` + assert_match /#{pattern}/, found.chomp, "Can't find #{pattern} in #{file}" end When /^I retrieve ([^ ]+) into ([^ ]+)$/ do |url,file| - system( "wget -q -O #{file} #{url}") + system( "wget -q -O #{file} #{url}") end Then /^a page\-asset should be ([^ ]+)$/ do |asset_path| - page.has_content?(asset_path) + page.has_content?(asset_path) end diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 7b08a650a3..abf1f721bd 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -72,7 +72,7 @@ end Given /^there is a user "([^\"]*)" who's tagged "([^\"]*)"$/ do |full_name, tag| username = full_name.gsub(/\W/, "").underscore - Given "a user named \"#{full_name}\" with email \"#{username}@example.com\"" + step "a user named \"#{full_name}\" with email \"#{username}@example.com\"" user = User.find_by_username(username) user.profile.tag_string = tag user.profile.build_tags diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index d7a57da2e9..0f16404da9 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -4,7 +4,6 @@ # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. - require 'uri' require 'cgi' require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) @@ -64,7 +63,7 @@ end When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| with_scope(selector) do fields.rows_hash.each do |name, value| - When %{I fill in "#{name}" with "#{value}"} + step %{I fill in "#{name}" with "#{value}"} end end end diff --git a/public/index.html b/public/index.html index 80e9e26882..9ca27dd12d 100644 --- a/public/index.html +++ b/public/index.html @@ -68,7 +68,7 @@ DIASPORA* ALPHA <div class='span-24 last' style=''> <div id='landing_content'> <div class='ilya'> -<a href="https://joindiaspora.com/u/ilya"><img alt="Seed" src="https://db78ml4vyrxnw.cloudfront.net/seed.jpg" /></a> + <a href="https://joindiaspora.com/u/ilya"><img alt="Seed" src="https://db78ml4vyrxnw.cloudfront.net/seed.jpg" /></a> <div class='memory'> <h1>Ilya Zhitomirskiy</h1> <h2>1989-2011</h2> diff --git a/spec/lib/webfinger_spec.rb b/spec/lib/webfinger_spec.rb index 0e7de2cd6d..87e7b74be1 100644 --- a/spec/lib/webfinger_spec.rb +++ b/spec/lib/webfinger_spec.rb @@ -11,15 +11,15 @@ describe Webfinger do let(:user1) { alice } let(:user2) { eve } - let(:account) {"foo@tom.joindiaspora.com"} - let(:person){ Factory(:person, :diaspora_handle => account)} - let(:finger){Webfinger.new(account)} + let(:account) { "foo@tom.joindiaspora.com" } + let(:person) { Factory(:person, :diaspora_handle => account) } + let(:finger) { Webfinger.new(account) } - let(:good_request) { FakeHttpRequest.new(:success)} + let(:good_request) { FakeHttpRequest.new(:success) } - let(:diaspora_xrd) {puts "requiring host-meta"; File.open(File.join(Rails.root, 'spec', 'fixtures', 'host-meta.fixture.html')).read} - let(:diaspora_finger) {File.open(File.join(Rails.root, 'spec', 'fixtures', 'webfinger.fixture.html')).read} - let(:hcard_xml) {File.open(File.join(Rails.root, 'spec', 'fixtures', 'hcard.fixture.html')).read} + let(:diaspora_xrd) { File.open(File.join(Rails.root, 'spec', 'fixtures', 'host-meta.fixture.html')).read } + let(:diaspora_finger) { File.open(File.join(Rails.root, 'spec', 'fixtures', 'webfinger.fixture.html')).read } + let(:hcard_xml) { File.open(File.join(Rails.root, 'spec', 'fixtures', 'hcard.fixture.html')).read } context 'setup' do @@ -28,7 +28,7 @@ describe Webfinger do n = Webfinger.new("mbs348@gmail.com") n.instance_variable_get(:@account).should_not be nil end - + it 'downcases account' do account = "BIGBOY@Example.Org" n = Webfinger.new(account) diff --git a/spec/models/services/twitter_spec.rb b/spec/models/services/twitter_spec.rb index a2d0f70cc1..ca4cab5627 100644 --- a/spec/models/services/twitter_spec.rb +++ b/spec/models/services/twitter_spec.rb @@ -30,7 +30,7 @@ describe Services::Twitter do describe "#profile_photo_url" do it 'returns the original profile photo url' do - stub_request(:get, "https://api.twitter.com/1/users/profile_image/joindiaspora.json?size=original"). + stub_request(:get, "https://api.twitter.com/1/users/profile_image/joindiaspora?size=original"). to_return(:status => 302, :body => "", :headers => {:location => "http://a2.twimg.com/profile_images/uid/avatar.png"}) @service.nickname = "joindiaspora" -- GitLab