From bdb77ff282ecb1d9f4b97e5814170eaa1dfb8552 Mon Sep 17 00:00:00 2001 From: Gabriel Gilder Date: Thu, 28 Oct 2010 20:57:18 -0700 Subject: [PATCH 1/9] redirecting to :back instead of manage page on failed aspect creation +spec --- app/controllers/aspects_controller.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 6887e4bee..ec1d9cb2e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -24,7 +24,7 @@ class AspectsController < ApplicationController respond_with @aspect else flash[:error] = I18n.t('aspects.create.failure') - redirect_to aspects_manage_path + redirect_to :back end end diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 7635bbfc1..9793a81e9 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -16,6 +16,7 @@ describe AspectsController do friend_users(@user,@aspect, @user2, @aspect2) @contact = @user.contact_for(@user2.person) sign_in :user, @user + request.env["HTTP_REFERER"] = 'http://' + request.host end describe "#index" do @@ -44,9 +45,9 @@ describe AspectsController do post :create, "aspect" => {"name" => ""} @user.reload.aspects.count.should == 2 end - it "goes back to manage aspects" do + it "goes back to the page you came from" do post :create, "aspect" => {"name" => ""} - response.should redirect_to(aspects_manage_path) + response.should redirect_to(:back) end end end From a1ccff048837ac5a4a39d60206b06594eac587d7 Mon Sep 17 00:00:00 2001 From: Curtis J Schofield Date: Thu, 28 Oct 2010 21:02:58 -0700 Subject: [PATCH 2/9] i put in a dash --- config/locales/diaspora/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 7071d13d4..2ab49b1e2 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -84,7 +84,7 @@ en: your_albums: "Your Albums" aspects: no_friends_message: - nobody: "We know you have friends, bring them to Diaspora!" + nobody: "We know you have friends — bring them to Diaspora!" nobody_in_aspect: "Your aspect '%{aspect_name}' is empty." add_friend: "Add a friend" add_friend_to: "Add someone to %{aspect_name}" From ef2c8fbfdcf63e488cb913a0fb89cf37c705c825 Mon Sep 17 00:00:00 2001 From: Sarah Allen Date: Thu, 28 Oct 2010 21:28:20 -0700 Subject: [PATCH 3/9] Rails.env is a string, not a symbol --- config/initializers/_load_app_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 723e38525..b66b0c8f9 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -23,4 +23,4 @@ end APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' -puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test +puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != "test" From 4db521657dda8d8276db983ee0b7de3060d5fee5 Mon Sep 17 00:00:00 2001 From: Himanshu Chhetri Date: Fri, 29 Oct 2010 20:31:45 -0700 Subject: [PATCH 4/9] Use FileUtils for all file operations. Also uses Kernel.system to execute shell commands in a secure fashion. --- lib/collect_user_photos.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/collect_user_photos.rb b/lib/collect_user_photos.rb index 4b0fedea2..d95aa386a 100644 --- a/lib/collect_user_photos.rb +++ b/lib/collect_user_photos.rb @@ -17,12 +17,12 @@ module PhotoMover current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}" new_photo_location = "#{album_dir}/#{photo.image_filename}" - `cp #{current_photo_location} #{new_photo_location}` + FileUtils::cp current_photo_location new_photo_location end end - `tar cf #{user.id}.tar #{user.id}` - `rm -r #{user.id}` + system("tar", "cf #{user.id}.tar #{user.id}") + FileUtils::rm_r user.id, :secure => true, :force => true "#{Rails.root}/#{temp_dir}.tar" end From 14ccf7229b2694a55e134151161f4bb5a28fee3a Mon Sep 17 00:00:00 2001 From: J David Eisenberg Date: Sat, 30 Oct 2010 22:01:02 -0700 Subject: [PATCH 5/9] Issue #492: Informal, vague description when signing up as a new user --- app/views/users/getting_started.html.haml | 2 +- config/locales/diaspora/en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 5edb3e67a..c90a3fadd 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -30,7 +30,7 @@ %h1{:style => "text-align:right;"} = "Welcome to Diaspora!" .description - Do the stuff below to further complete some things. + =t('.signup_steps') %h3{:style => "text-align:right;"} = link_to "Edit your profile", getting_started_path(:step => 1) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index d61abb8a2..ac85617c0 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -143,6 +143,7 @@ en: cancel: "Cancel" destroy: "Account successfully closed." getting_started: + signup_steps: "Complete your sign-up by doing these things:" 'step_1': albums: "Albums" you_dont_have_any_photos: "You don't have any photos! Go to the" From cf6c2deba327805837eb40f627574420fb031c00 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 31 Oct 2010 22:54:26 +0100 Subject: [PATCH 6/9] Added missing strings to swedish translation --- config/locales/devise/devise.sv.yml | 24 +++++++-- config/locales/diaspora/sv.yml | 82 +++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 20 deletions(-) diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index 0366d0c49..419d90deb 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -8,6 +8,7 @@ sv: errors: messages: not_found: "kan ej hitta" + already_confirmed: "är redan bekräftad" not_locked: "var ej låst" devise: @@ -15,11 +16,16 @@ sv: unauthenticated: 'Du måste logga in innan du kan fortsätta.' unconfirmed: 'Du måste verifiera ditt konto innan du kan fortsätta.' locked: 'Ditt konto är låst.' - invalid: 'Felaktig användare eller lösenord.' + invalid: 'Felaktigt användarnamn eller lösenord.' invalid_token: 'Ogiltig identifiering.' timeout: 'Din session är avslutad, var vänlig logga in igen.' inactive: 'Ditt konto är inte aktiverat.' sessions: + new: + login: 'Logga in' + username: 'Användarnamn' + password: 'Lösenord' + sign_in: 'Logga in' signed_in: 'Inloggning ok.' signed_out: 'Utloggning ok.' passwords: @@ -40,6 +46,16 @@ sv: invitation_token_invalid: 'Denna inbjudan är ej giltig!' updated: 'Ditt lösenord är nu inställt och du är inloggad.' mailer: - confirmation_instructions: 'Instruktioner för att verifiera ditt konto.' - reset_password_instructions: 'Instruktioner för att återställa ditt lösenord.' - unlock_instructions: 'Instruktioner för att låsa upp ditt konto.' + confirmation_instructions: + subject: 'Instruktioner för att verifiera ditt konto.' + reset_password_instructions: + subject: 'Instruktioner för att återställa ditt lösenord.' + unlock_instructions: + subject: 'Instruktioner för att låsa upp ditt konto.' + invitation: + subject: 'En vän vill att du ska gå med i Diaspora!' + shared: + links: + sign_in: 'Logga in' + sign_up: 'Registrera dig' + forgot_your_password: 'Glömt ditt lösenord?' diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 968a3cafa..d5b18e6fa 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -27,6 +27,8 @@ sv: models: user: attributes: + person: + invalid: "är ogiltigt" username: taken: "är redan taget" email: @@ -35,7 +37,6 @@ sv: attributes: diaspora_handle: taken: "är redan taget" - hello: "Hej världen!" application: helper: @@ -54,7 +55,10 @@ sv: people_on_pod_are_aware_of: " personer på denna plats är medvetna om att" layouts: application: + view_profile: "visa profil" edit_profile: "ändra profil" + account_settings: "kontoinstallningar" + search: "Search" logout: "logga ut" shared: aspect_nav: @@ -81,8 +85,10 @@ sv: updated: "uppdaterad" by: "av" edit: + album_name: "Namn på fotoalbum" editing: "Ändrar" updated: "uppdaterad" + update_album: "Uppdatera fotoalbum" are_you_sure: "Är du säker?" delete_album: "Ta bort fotoalbum" cancel: "Avbryt" @@ -117,6 +123,7 @@ sv: ignore_remove: "Ignorera/Ta bort" new_aspect: add_a_new_aspect: "Lägg till ny sida" + name: "Namn" create: "Skapa" create: success: "Klicka på plustecknet till höger för att välja vilka som kan se din nya sida." @@ -137,19 +144,26 @@ sv: users: edit: editing_profile: "Ändrar profil" - profile: + invite_friends: "Bjud in en vän" + are_you_sure: "Är du säker?" + export_data: "Exportera data" + close_account: "Stäng kontot" + change_language: "Ändra språk" + change_password: "Ändra lösenord" + new_password: "Nytt lösenord" + password_confirmation: "Bekräfta lösenord" + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" cancel: "Avbryt" - update_profile: "Uppdatera Profil" - home: "Hem" - diaspora_username: "Diaspora-användarnamn:" - info: "Info" - picture: "Profilbild" - editing_profile: "Ändrar profil" - albums: "Album" - you_dont_have_any_photos: "Du har inga foton! Gå till" - page_to_upload_some: "sidan för att ladda upp några." - or: "eller" destroy: "Ditt konto är nu stängt." + getting_started: + 'step_1': + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" comments: comment: ago: "sedan" @@ -189,6 +203,13 @@ sv: registrations: new: sign_up: "Registrera dig" + sign_up_for_diaspora: "Gå med i Diaspora" + upload_existing_account: "Ladda upp ett befintligt Diaspora-konto" + upload: "Ladda upp" + username: "Användarnamn" + email: "E-post address" + password: "Lösenord" + password_confirmation: "Bekräfta lösenord" create: success: "Du har nu gått med i Diaspora!" invitations: @@ -232,10 +253,6 @@ sv: new: new_person: "Ny person" back_to_list: "Tillbaka till listan" - edit: - cancel: "Avbryt" - or: "eller" - update_profile: "Uppdatera profil" show: last_seen: "senast sedd: %{how_long_ago}" friends_since: "vänner sedan: %{how_long_ago}" @@ -243,12 +260,39 @@ sv: are_you_sure: "Är du säker?" remove_friend: "ta bort vän" no_posts: "ingenting att visa!" + add_friend: "lägg till en vän" + edit: + settings: "Inställningar" + your_profile: "Din profil" + your_name: "Ditt namn" + first_name: "Förnamn" + last_name: "Efternamn" + your_gender: "Ditt kön" + your_birthday: "Din födelsedag" + your_bio: "Din biografi" + fill_me_out: "Fyll i mig" + your_photo: "Ditt foto" + profile: "Profil" + account: "Konto" + services: "Tjänster" + cancel: "Avbryt" + update_profile: "Uppdatera profil" + home: "Hem" + diaspora_username: "Användarnamn:" + info: "Info" + picture: "Foto" + editing_profile: "Ändrar profil" + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" requests: new_request: add_a_new_friend_to: "Lägg till en vän till" enter_a_diaspora_username: "Ange ett användarnamn:" your_diaspora_username_is: "Din Diaspora-adress är: %{diaspora_handle}" friends_username: "Vännens Diaspora-adress" + create_request: "Skapa förfrågan" destroy: success: "Ni är nu vänner." error: "Var god välj en aspekt!" @@ -261,6 +305,12 @@ sv: already_friends: "Du är redan vän med %{destination_url}!" success: "En vänförfrågan har skickats till %{destination_url}." horribly_wrong: "Nu gick något rejält fel här." + services: + index: + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" # The following is from the rails-i18n project at http://github.com/svenfuchs/rails-i18n From cb09249058b0a045d0fb0c2c7e83e29cfb86d7d4 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 31 Oct 2010 22:49:40 -0700 Subject: [PATCH 7/9] Refactor aspect cucumber feature - now happy path only. --- features/manages_aspects.feature | 14 ++++++++++++++ features/user_creates_an_aspect.feature | 21 --------------------- 2 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 features/manages_aspects.feature delete mode 100644 features/user_creates_an_aspect.feature diff --git a/features/manages_aspects.feature b/features/manages_aspects.feature new file mode 100644 index 000000000..74f6744f4 --- /dev/null +++ b/features/manages_aspects.feature @@ -0,0 +1,14 @@ +@aspects @javascript +Feature: User manages aspects + In order to share with a limited group + As a User + I want to create new aspects + + Scenario: creating an aspect + Given I am signed in + When I follow "Manage" in the header + And I follow "Add a new aspect" + And I fill in "Name" with "Dorm Mates" in the modal window + And I press "Create" in the modal window + Then I should see "Dorm Mates" in the header + And I should see "Your aspect 'Dorm Mates' is empty." diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature deleted file mode 100644 index d611d412f..000000000 --- a/features/user_creates_an_aspect.feature +++ /dev/null @@ -1,21 +0,0 @@ -@aspects @javascript -Feature: User creates an aspect - In order to share with a limited group - As a User - I want to create a new aspect - - Background: - Given I am signed in - And I follow "Manage" in the header - And I follow "Add a new aspect" - - Scenario: success - Given I fill in "Name" with "Dorm Mates" in the modal window - When I press "Create" in the modal window - Then I should see "Dorm Mates" in the header - And I should see "Your aspect 'Dorm Mates' is empty." - - Scenario: I omit the name - Given I fill in "Name" with "" in the modal window - When I press "Create" in the modal window - Then I should see "Aspect creation failed." From 9594e11ded9fe1c5338aecd046c3c8e0f4101d8c Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 31 Oct 2010 22:50:20 -0700 Subject: [PATCH 8/9] Add feature for skipping the setup wizard. --- features/signs_up.feature | 16 ++++------------ features/step_definitions/custom_web_steps.rb | 4 ++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/features/signs_up.feature b/features/signs_up.feature index e64b066e7..d449034cf 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -1,7 +1,7 @@ @javascript Feature: new user registration - Scenario: new user sees profile wizard + Background: When I go to the new user registration page And I fill in "Username" with "ohai" And I fill in "Email" with "ohai@example.com" @@ -11,6 +11,7 @@ Feature: new user registration Then I should be on the getting started page And I should see "Welcome to Diaspora!" + Scenario: new user goes through the setup wizard When I fill in "person_profile_first_name" with "O" And I fill in "person_profile_last_name" with "Hai" And I press "Save and continue" @@ -32,17 +33,8 @@ Feature: new user registration Then I should be on the home page And I should see "We know you have friends, bring them to Diaspora!" - @wip - Scenario: new user can skip the profile wizard - When I go to the new user registration page - And I fill in "Username" with "ohai" - And I fill in "Email" with "ohai@example.com" - And I fill in "Password" with "secret" - And I fill in "Password confirmation" with "secret" - And I press "Sign up" - Then I should be on the getting started page - And I should see "Welcome to Diaspora!" - + Scenario: new user skips the setup wizard When I follow "skip getting started" + And I wait for the home page to load Then I should be on the home page And I should see "We know you have friends, bring them to Diaspora!" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index d213cbf4d..c98150d3d 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -20,4 +20,8 @@ Then /^I should see "([^\"]*)" in the main content area$/ do |stuff| within("#stream") do Then "I should see #{stuff}" end +end + +When /^I wait for the home page to load$/ do + wait_until { current_path == root_path } end \ No newline at end of file From cc521261c8b74796ec705090721b732693c1808e Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 1 Nov 2010 00:55:16 -0700 Subject: [PATCH 9/9] Forgot to change spelling in feature --- features/signs_up.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/signs_up.feature b/features/signs_up.feature index d449034cf..80e32934f 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -31,10 +31,10 @@ Feature: new user registration When I follow "Continue on to your everyone page, an overview of all of your aspects." Then I should be on the home page - And I should see "We know you have friends, bring them to Diaspora!" + And I should see "bring them to Diaspora!" Scenario: new user skips the setup wizard When I follow "skip getting started" And I wait for the home page to load Then I should be on the home page - And I should see "We know you have friends, bring them to Diaspora!" + And I should see "bring them to Diaspora!"