guard

Using guard-rspec with factory-girl-rails

梦想与她 提交于 2019-12-06 11:01:27
I'm using factory_girl_rails as a replacement for fixtures in my Rails project. I'm also using guard-rspec to automatically run my specs. Guard is not picking up the changes I make to my factory files (e.g. spec/factories/users.rb )—I have to stop guard, then reinitialize it for it to pick up those changes. What are some options for avoiding this manual process? Daniël W. Crompton To add to your own answer: I limit what it runs, so it doesn't run too much: watch(%r{^spec/factories/(.+)\.rb$}) { "spec/models" } or including the relevant controller: watch(%r{^spec/factories/(.+)\.rb$}) { |m| [

check multiple guard in Laravel controller

有些话、适合烂在心里 提交于 2019-12-06 03:36:16
问题 I create three types of guards in laravel, I can check auth users but we have some route and controller that is same for all users and I need to check all guards in the same routes or controllers for each type of users that log in. my auth.php file looks like this <?php return [ 'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ], 'admin' => [ 'driver' =>

Guard won't load WDM

浪子不回头ぞ 提交于 2019-12-05 04:18:17
I'm working through Michael Hartl's Rails tutorial which is excellent so far. I'm on the Advanced Setup Chapter, where he goes through configuring the Rails environment in a way conducive to TDD. I installed Guard, and it runs properly all the way through running the tests I have in my spec/ folder. But then, it spits out this error: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.0.2/lib/listen/adapter.rb:195:in `require': cannot load such file -- wdm (LoadError) I have wdm installed. I don't know why it can't load it. It seems like Listen is having problems loading up WDM. It

Guard --listen-on with vagrant

一曲冷凌霜 提交于 2019-12-04 23:12:09
问题 I am trying to use guard's --listen-on option with vagrant as outlined here, but I am unable to get it to work. If I add config.vm.network :forwarded_port, guest: 4000, host: 4000 to my Vagrantfile and subsequently try to start listen with listen -f 127.0.0.1:4000 , I get an error: Broadcaster.initialize: Address already in use - bind(2) for "127.0.0.1" port 4000 . If I try to start listen and then start vagrant, vagrant complains similarly: Vagrant cannot forward the specified ports on this

how to guard a controller through multiple of user?

限于喜欢 提交于 2019-12-04 21:03:26
It is project requirement. where i have multiple logins but some user can not access few module. like super admin and analyst can access all module but developer can only use own controller. so in this case , how can i guard a controller with multiple logins. also note that i have separate login page and table into Database. for Example phonebookController can be access by super admin and analyst but not by developers. so please tell me how can i implement this? i use this for :: if( Auth::guard('superAdmin')->check() ) { $author =Auth::guard('superAdmin')->User()->id ; } else if( Auth::guard(

Angular guards, unclear statement in the docs

余生长醉 提交于 2019-12-04 16:30:39
问题 I'm trying to understand angular deeply, so i read the docs and it was very helpful. now i'm studying the guards. and i read this statement in the docs. The router checks the CanDeactivate and CanActivateChild guards first, from the deepest child route to the top. Then it checks the CanActivate guards from the top down to the deepest child route. now i'm confused, why does angular perform it in this way? is there any benefits of doing the checking from the deepest child to the top for

Is it impossible to use Guard with RubyMine?

穿精又带淫゛_ 提交于 2019-12-04 07:25:46
问题 For some inexplicable reason, RubyMine autosaves every change you make and so every key stroke will trigger Guard to run your tests! And the most ridiculous thing is that there's apparently no way to disable this autosaving "feature". I'm just wondering, RubyMine seems to be a very popular editor among Rails developers and Guard seems to be an indispensable tool used to automate testing. Since Guard is impossible to use reasonably with RubyMine, how do people deal with automating their tests

Guardfile for running single cucumber feature in subdirectory?

て烟熏妆下的殇ゞ 提交于 2019-12-04 05:26:26
I have my features organized in subfolders, like this: app/ features/ users/ feature1.feature feature2.feature But everytime I save a feature, Guard runs all my features (not just the one that was edited). How can I change it to only run the one that was saved? Here's my Guardfile for Cucumber: guard 'cucumber', :cli => "--drb --require features/support --require features/step_definitions" do watch(%r{features/.+\.feature}) watch(%r{features/support/.+}) { 'features' } watch(%r{features/step_definitions/(.+)_steps\.rb}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' } end Aph, the

Angular2 Exploring Resolved Data in canActivate Guard?

纵然是瞬间 提交于 2019-12-04 02:08:24
Is it possible to access resolved data of a route (-Resolver) inside a canActivate guard. Currently I can access the resolved data in the component by ngOnInit() { this.route.data .subscribe((data: { example: Array<Object> }) => { this.example = data.example; console.log('example resolver', this.example); }); } How could I manage that in the canActivate guard? This is not working: constructor(private route: ActivatedRoute) {} canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot, ): boolean { this.route.data .subscribe((data: { example: Array<Object> }) => { this.example =

LiveReload not working Guard (Firefox)

☆樱花仙子☆ 提交于 2019-12-03 10:39:21
问题 I'm having a fun issue, I have LiveReload working in Chrome, so I know it's installed right, but I can't for the life of me get it going on Firefox 9.0.1. I activate the icon on my site and it just stays red, with the following symptom showing in my guard terminal. Browser connected. Browser URL: {"command":"hello","protocols":["http://livereload.com/protocols/connection-check-1"]} Browser disconnected. Here's my guardfile. guard 'livereload' do watch(%r{app/.+\.(erb|haml)}) watch(%r{app