Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

api: added create and update methods to registries #1663

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

mssola
Copy link
Collaborator

@mssola mssola commented Feb 7, 2018

Signed-off-by: Miquel Sabaté Solà [email protected]

@vitoravelino
Copy link
Contributor

This is not really api but since you've already created the services objects, it's much easier to move them to grape later.

@vitoravelino
Copy link
Contributor

Coverage failed :(

@mssola
Copy link
Collaborator Author

mssola commented Feb 7, 2018

This is not really api but since you've already created the services objects, it's much easier to move them to grape later.

I have created the API endpoints 😕

@vitoravelino
Copy link
Contributor

For some reason I didn't see the update in the api/registries.rb file. Sorry! 😅

@mssola
Copy link
Collaborator Author

mssola commented Feb 7, 2018

@vitoravelino tests are passing

def check_uniqueness!
return unless Registry.any?
@valid = false
@messages[:status] = "You can only create one registry"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is status the best name? We were using field names but in this case it's not related to a field. Just wondering...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know how to name it... Maybe uniqueness ? or limit ? or instances ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think uniqueness is fine. What do you think?

expect(resp["errors"]["status"]).to eq("You can only create one registry")
end

it "returns an error un unreachable registry" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

un?

expect(reg.name).to eq(just_name[:registry][:name])
end

it "returns an error un unreachable registry" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

un?

expect(resp["errors"]["hostname"]).to eq("Registry is not empty, cannot change hostname")
end

it "allows to update if there are repositories and you don't speak about the hostname" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and you don't change/touch the hostname

vitoravelino
vitoravelino previously approved these changes Feb 7, 2018
Copy link
Contributor

@vitoravelino vitoravelino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Just need to fix/improve the naming and typos.

@mssola mssola merged commit d096db5 into SUSE:master Feb 8, 2018
@mssola mssola deleted the registry-create branch February 8, 2018 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants