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

fix and implement missing resource controller specs #3356

Merged
merged 4 commits into from Aug 31, 2014

Conversation

timoschilling
Copy link
Member

Commit 1

The old 2 skipped tests are failing while this overwrites the rspec post method:

let(:post) { Post.new title: "An incledibly unique Post Title" }

To use a post request in a unit spec is not a good choice, while with post you can't expect a internal rised error, you can only expect the external error, so I change it.

Commit 2

This is not the best way, but it looks like this is the only one and we don't need to test the right behavior of instance_exec.

@@ -224,36 +224,34 @@ def call_after_destroy(obj); end

describe "performing batch_action" do
let(:controller){ Admin::PostsController.new }
let(:batch_action) { ActiveAdmin::BatchAction.new :flag, "Flag", &batch_action_block }
let(:batch_action_block) { lambda { |*| } }
Copy link
Contributor

Choose a reason for hiding this comment

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

The other option is to use a proc here:

let(:batch_action_block) { proc { } }

Since procs don't check their arguments, but lambdas do.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.22%) when pulling 5d2cc6f on timoschilling:specs into 83059dc on activeadmin:master.

seanlinsley added a commit that referenced this pull request Aug 31, 2014
fix and implement missing resource controller specs
@seanlinsley seanlinsley merged commit 28a0c1c into activeadmin:master Aug 31, 2014
@timoschilling timoschilling deleted the specs branch September 14, 2014 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants