Skip to content

Commit f7b40c8

Browse files
committed
Merge branch 'master' of github.com:fredwu/angel_nest
2 parents 85cba42 + 998e122 commit f7b40c8

File tree

6 files changed

+33
-30
lines changed

6 files changed

+33
-30
lines changed

app/controllers/users_controller.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ def show
2222

2323
def message_inboxes
2424
@messages = case params[:type].try(:to_sym)
25+
when :inbox_messages then current_user.inbox_messages
2526
when :sent_messages then current_user.sent_messages
2627
when :archived_messages then current_user.archived_messages
2728
when :inbox_proposals then current_user.inbox_proposals
2829
when :sent_proposals then current_user.sent_proposals
2930
when :archived_proposals then current_user.archived_proposals
30-
else current_user.inbox_messages
31+
else redirect_to my_message_inbox_path(:inbox_messages)
3132
end
3233
end
3334

app/views/devise/shared/_links.slim

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
hr
2-
ul
3-
- if controller_name != 'sessions'
4-
li= link_to "Sign in", new_session_path(resource_name)
5-
- if devise_mapping.registerable? && controller_name != 'registrations'
6-
li= link_to "Sign up", new_registration_path(resource_name)
7-
- if devise_mapping.recoverable? && controller_name != 'passwords'
8-
li= link_to "Forgot your password?", new_password_path(resource_name)
9-
- if devise_mapping.confirmable? && controller_name != 'confirmations'
10-
li= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
11-
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
12-
li= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
13-
- if devise_mapping.omniauthable?
14-
- resource_class.omniauth_providers.each do |provider|
15-
li= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
1+
- unless current_user
2+
hr
3+
ul
4+
- if controller_name != 'sessions'
5+
li= link_to "Sign in", new_session_path(resource_name)
6+
- if devise_mapping.registerable? && controller_name != 'registrations'
7+
li= link_to "Sign up", new_registration_path(resource_name)
8+
- if devise_mapping.recoverable? && controller_name != 'passwords'
9+
li= link_to "Forgot your password?", new_password_path(resource_name)
10+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
11+
li= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
12+
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
13+
li= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
14+
- if devise_mapping.omniauthable?
15+
- resource_class.omniauth_providers.each do |provider|
16+
li= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)

app/views/messages/show_private_message.html.slim

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
.grid_3
22
= render 'users/message_inboxes'
33
.grid_9
4+
- if @topic.is_with_proposal?
5+
hr
6+
h1= t('label.business_proposal')
7+
.read_only= render 'proposals/form', :resource => @topic.proposal, :submit_path => '/'
8+
9+
h2= t('label.comments')
410
ul#messages
511
li.message= render 'show', :resource => @topic, :meta => {}
612
- @topic.replies.each do |reply|
713
li.message= render 'show', :resource => reply, :meta => {}
814
br
915
= render 'new', :url => my_private_message_path(@topic)
10-
- if @topic.is_with_proposal?
11-
hr
12-
h1= t('label.business_proposal')
13-
.read_only= render 'proposals/form', :resource => @topic.proposal, :submit_path => '/'

app/views/users/_index.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ul.resource_list.user_list
22
- collection.each do |user|
3-
li.mini_profile data-target_link="#{startup_profile_team_path(meta[:parent])}" data-edit_target="#profile_team"
3+
li.mini_profile data-target_link="#{startup_profile_team_path(meta[:parent]) if meta[:parent]}" data-edit_target="#profile_team"
44
- unless meta[:role_identifier]
55
hr
66

app/views/users/_mini_profile.html.slim

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
- if user == current_user
2-
= render 'shared/editable', :url => edit_registration_path(user)
3-
41
.mini_profile
52
.profile_pic
63
= render 'users/avatar', :user => user, :meta => {}

spec/requests/user_session_spec.rb

+8-6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def sign_in_user(login = user.email)
3939
response.body.should include(user.name)
4040
end
4141

42+
it "rejects signing in with incorrect login" do
43+
sign_in_user('dummy')
44+
45+
response.body.should include('Invalid email or password.')
46+
end
47+
4248
it "signs out" do
4349
sign_in_user
4450
get destroy_user_session_path
@@ -49,17 +55,13 @@ def sign_in_user(login = user.email)
4955
end
5056

5157
it "sends user confirmation instructions" do
52-
post user_confirmation_path, :user => {
53-
:email => user_unconfirmed.email
54-
}
58+
post user_confirmation_path, :user => { :email => user_unconfirmed.email }
5559

5660
response.should redirect_to(new_user_session_path)
5761
end
5862

5963
it "sends reset password instructions" do
60-
post user_password_path, :user => {
61-
:login => user.email
62-
}
64+
post user_password_path, :user => { :login => user.email }
6365

6466
response.should redirect_to(new_user_session_path)
6567
end

0 commit comments

Comments
 (0)