-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_spec.rb
33 lines (29 loc) · 898 Bytes
/
create_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'spec_helper'
require_relative '../../../../apps/web/controllers/user/create'
describe Web::Controllers::User::Create do
let(:action) { Web::Controllers::User::Create.new }
let(:params) do
{
data: {
attributes: {
email: 'th@skalar.no',
password: 'secret',
alternative_emails: [
{email: "th@skalar.no", description: "work"},
{email: "th@home.no", description: "home"}
]
}
}
}
end
it 'is successful' do
response = action.call(params)
response_json = JSON.parse response[2].first
response_json['email'].must_equal 'th@skalar.no'
response_json['password'].must_equal 'secret'
response_json['alternative_emails'].must_equal [
{"email" => "th@skalar.no", "description" => "work"},
{"email" => "th@home.no", "description" => "home"}
]
end
end