diff options
Diffstat (limited to 'spec/requests/keys_spec.rb')
-rw-r--r-- | spec/requests/keys_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/requests/keys_spec.rb b/spec/requests/keys_spec.rb index 316115f9234..6ce22b30883 100644 --- a/spec/requests/keys_spec.rb +++ b/spec/requests/keys_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' describe "Issues" do - before do + before do login_as :user end describe "GET /keys" do - before do + before do @key = Factory :key, :user => @user visit keys_path end @@ -15,8 +15,8 @@ describe "Issues" do it { should have_content(@key.title) } - describe "Destroy" do - it "should remove entry" do + describe "Destroy" do + it "should remove entry" do expect { click_link "destroy_key_#{@key.id}" }.to change { @user.keys.count }.by(-1) @@ -24,17 +24,17 @@ describe "Issues" do end end - describe "New key", :js => true do - before do + describe "New key", :js => true do + before do visit keys_path click_link "Add new" end - it "should open new key popup" do + it "should open new key popup" do page.should have_content("Add new public key") end - describe "fill in" do + describe "fill in" do before do fill_in "key_title", :with => "laptop" fill_in "key_key", :with => "publickey234=" @@ -42,7 +42,7 @@ describe "Issues" do it { expect { click_button "Save" }.to change {Key.count}.by(1) } - it "should add new key to table" do + it "should add new key to table" do click_button "Save" page.should_not have_content("Add new public key") |