Skip to content

Instantly share code, notes, and snippets.

@parthaa
Created March 6, 2013 18:11
Show Gist options
  • Save parthaa/5101602 to your computer and use it in GitHub Desktop.
Save parthaa/5101602 to your computer and use it in GitHub Desktop.
def test_duplicate_name
attrs = FactoryGirl.attributes_for(:content_view_definition,
:name => @content_view_def.name
)
assert_raises(ActiveRecord::RecordInvalid) do
ContentViewDefinition.create!(attrs)
end
cv = ContentViewDefinition.create(attrs)
refute cv.persisted?
refute cv.save
end
@parthaa
Copy link
Author

parthaa commented Mar 6, 2013

require "minitest_helper"

class Api::FiltersControllerTest < MiniTest::Rails::ActionController::TestCase
fixtures :all

def setup
@filter = filter
login_user(users(:admin))
models = models = ["Organization", "KTEnvironment", "User","ContentViewEnvironment", "ContentViewDefinition"]
services = ["Candlepin", "Pulp", "ElasticSearch"]
disable_glue_layers(services, models)
end

test "should return a list of filters" do
get :index, :organization => @filter.content_definition.organization.lablel, :definition=> @filter.content_definition.id
assert_response :success
end
end

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