saucy 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,7 +55,7 @@ module Saucy
55
55
  private
56
56
 
57
57
  def current_project
58
- @project ||= ::Project.find_by_keyword!(params[:id])
58
+ @project ||= current_account.projects.find_by_keyword!(params[:id])
59
59
  end
60
60
 
61
61
  def ensure_account_within_projects_limit
@@ -33,7 +33,7 @@ end
33
33
  describe ProjectsController, "#show as another user" do
34
34
  let(:account) { Factory(:account) }
35
35
  let(:user) { Factory(:user) }
36
- let(:project) { Factory(:project) }
36
+ let(:project) { Factory(:project, :account => account) }
37
37
  before do
38
38
  sign_in_as(user)
39
39
  get :show, :account_id => account.to_param, :id => project.to_param
@@ -139,3 +139,16 @@ describe ProjectsController, "as a non-admin", :as => :project_member do
139
139
  flash(/admin/) }
140
140
  end
141
141
 
142
+ describe ProjectsController, "show for a duplicate project keyword", :as => :project_admin do
143
+ before do
144
+ Factory(:project, :keyword => "test")
145
+
146
+ account = Factory(:account)
147
+ project = Factory(:project, :account => account, :keyword => "test")
148
+ sign_in_as_non_admin_of_project(project)
149
+ get :show, :id => "test", :account_id => account.to_param
150
+ end
151
+
152
+ it { should respond_with(:success) }
153
+ it { should_not set_the_flash }
154
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-03-31 00:00:00 -04:00
21
+ date: 2011-04-04 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency