File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ def dashboard
21
21
22
22
def show
23
23
super
24
- @destination_account = @offer
25
- . user
26
- . members
27
- . find_by ( organization : current_organization )
28
- . account
24
+
25
+ if current_user
26
+ @destination_account = @offer
27
+ . user
28
+ . members
29
+ . find_by ( organization : current_organization )
30
+ . account
31
+ end
29
32
end
30
33
end
Original file line number Diff line number Diff line change 62
62
describe "GET #show" do
63
63
context "with valid params" do
64
64
context "with a logged user" do
65
- it "assigns the requested offer to @offer" do
66
- login ( another_member . user )
65
+ before { login ( another_member . user ) }
67
66
68
- get "show" , id : offer . id
67
+ it "assigns the requested offer to @offer" do
68
+ get :show , id : offer . id
69
69
expect ( assigns ( :offer ) ) . to eq ( offer )
70
70
end
71
71
72
72
it 'assigns the account destination of the transfer' do
73
- login ( another_member . user )
74
-
75
73
get :show , id : offer . id
76
74
expect ( assigns ( :destination_account ) ) . to eq ( member . account )
77
75
end
78
76
end
79
77
80
78
context "without a logged in user" do
81
79
it "assigns the requested offer to @offer" do
82
- get " show" , id : offer . id
80
+ get : show, id : offer . id
83
81
expect ( assigns ( :offer ) ) . to eq ( offer )
84
82
end
85
83
end
You can’t perform that action at this time.
0 commit comments