Commit 2f60cfca authored by Vijay Hawoldar's avatar Vijay Hawoldar

Update Member entity to expose member state

To support rending of pending members as part of the User Cap feature
work, we need to expose the member state as well as the user state

Changelog: added
EE: true
parent c2286672
......@@ -65,7 +65,8 @@ Example response:
"web_url": "http://192.168.1.8:3000/root",
"expires_at": "2012-10-22T14:13:35Z",
"access_level": 30,
"group_saml_identity": null
"group_saml_identity": null,
"membership_state": "active"
},
{
"id": 2,
......@@ -81,7 +82,8 @@ Example response:
"extern_uid":"ABC-1234567890",
"provider": "group_saml",
"saml_provider_id": 10
}
},
"membership_state": "active"
}
]
```
......@@ -126,7 +128,8 @@ Example response:
"web_url": "http://192.168.1.8:3000/root",
"expires_at": "2012-10-22T14:13:35Z",
"access_level": 30,
"group_saml_identity": null
"group_saml_identity": null,
"member_stateship": "active"
},
{
"id": 2,
......@@ -142,7 +145,8 @@ Example response:
"extern_uid":"ABC-1234567890",
"provider": "group_saml",
"saml_provider_id": 10
}
},
"member_stateship": "active"
},
{
"id": 3,
......@@ -153,7 +157,8 @@ Example response:
"web_url": "http://192.168.1.8:3000/root",
"expires_at": "2012-11-22T14:13:35Z",
"access_level": 30,
"group_saml_identity": null
"group_saml_identity": null,
"member_stateship": "active"
}
]
```
......@@ -191,7 +196,8 @@ Example response:
"email": "john@example.com",
"created_at": "2012-10-22T14:13:35Z",
"expires_at": null,
"group_saml_identity": null
"group_saml_identity": null,
"member_stateship": "active"
}
```
......@@ -229,7 +235,8 @@ Example response:
"access_level": 30,
"email": "john@example.com",
"expires_at": null,
"group_saml_identity": null
"group_saml_identity": null,
"member_stateship": "active"
}
```
......
......@@ -15,6 +15,8 @@ module EE
expose :override,
if: ->(member, _) { member.source_type == 'Namespace' && member.ldap? }
expose :human_state_name, as: :membership_state
end
end
end
......
......@@ -51,4 +51,11 @@ RSpec.describe API::Entities::Member do
expect(entity_representation.keys).not_to include(:email)
end
end
context 'with state' do
it 'exposes human_state_name as membership_state' do
expect(entity_representation.keys).to include(:membership_state)
expect(entity_representation[:membership_state]).to eq member.human_state_name
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment