Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add URL Validation #243

Open
2 tasks
DBNess opened this issue Jul 3, 2014 · 1 comment
Open
2 tasks

Add URL Validation #243

DBNess opened this issue Jul 3, 2014 · 1 comment

Comments

@DBNess
Copy link
Member

DBNess commented Jul 3, 2014

Description
URLs are stored, displayed, and linked to for Organizations and for individual Projects. They're entered into the database primarily in Admin by admin users, but also created through the public project submission form. It would be great to test their validity before rendering links (and ideally before saving to the database at all).

Ask
Add validation logic and test to verify stored :url on both the Organization and Project models.

To Do

  • Add validation logic and test to verify Organization#url
  • Add validaiton logic and test to verify Project#url

Additional Info
Sample test code from #226 (Measure and Improve Test Coverage), though this may change if you decide to validate in the models themselves.

      it "returns an empty string if its url is invalid" do
        organization.stub(url: "random thing")
        expect(organization.display_url).to eq(nil)
      end
@DBNess
Copy link
Member Author

DBNess commented Jul 3, 2014

Possible suggestion (also quite possibly overkill): https://gist.github.com/johnjohndoe/7022109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant